]> git.evergreen-ils.org Git - working/Evergreen.git/commit
Protect against overly long savepoint names
authorDan Scott <dscott@laurentian.ca>
Fri, 11 Jan 2013 06:32:13 +0000 (01:32 -0500)
committerBill Erickson <berick@esilibrary.com>
Wed, 16 Jan 2013 20:00:58 +0000 (15:00 -0500)
commit8d51da5033f82c668db6b07f1cbec8269e4cd2bc
tree18ba721b6c161a199787e162f2f4481d5f11b7ea
parentce9d5391b7b51af91a8827ebff555624bca809e4
Protect against overly long savepoint names

Per http://postgresql.org/docs/9.1/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS,
the maximum identifier length works out to being 63 bytes (+1 for the
null terminator), so to avoid potential memory pressure by a 10GB string
somehow being passed in as the savepoint name, malloc no more than 64
bytes and copy no more than 63 bytes from the incoming name to the
escaped name.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/c-apps/oils_sql.c