]> 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)
committerDan Scott <dscott@laurentian.ca>
Wed, 16 Jan 2013 20:20:46 +0000 (15:20 -0500)
commit098a92af47770a3b7c2a73c5293c279082387ce0
treedaff98c6bded69844afce18aebc5a49dbfdd9b26
parent6ec9a532d2e5d7dbb89089f456e4455bfa92f2ed
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