Protect against overly long savepoint names
authorDan Scott <dscott@laurentian.ca>
Fri, 11 Jan 2013 06:32:13 +0000 (01:32 -0500)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 16 Jan 2013 17:23:31 +0000 (12:23 -0500)
commitafd508b93c5f847073457dbbe2b80391368448e1
treeeb4b9272604abe2993a20d09cd4d91250b99ca12
parentdf3e58f69423142418baf9583fb82d6691d55235
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