Protect against overly long savepoint names
authorDan Scott <dscott@laurentian.ca>
Fri, 11 Jan 2013 06:32:13 +0000 (01:32 -0500)
committerDan Scott <dscott@laurentian.ca>
Thu, 17 Jan 2013 04:53:09 +0000 (23:53 -0500)
commit33974d4b4ec191e21cd8fe6e4b023e9d9b72b5b1
tree6661feae9ad43eea5685c416bc2a768f80e75301
parent9434f42c88f5cf99b3ca9980bd5a98b2bccf6a1b
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