]> git.evergreen-ils.org Git - 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:05:03 +0000 (15:05 -0500)
commit6e02bd65f4ac6fa2f506e1e6dc842fd943f1672a
treefcda0c717f1e084663e9b7f6b70b08779be4589c
parentc94c559a17322a464cd6f9096942ec0a8585f65c
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