]> git.evergreen-ils.org Git - Evergreen.git/commit
Sanity check cstore limit/offset param values
authorBill Erickson <berick@esilibrary.com>
Thu, 16 Aug 2012 19:40:58 +0000 (15:40 -0400)
committerDan Scott <dscott@laurentian.ca>
Wed, 22 Aug 2012 01:34:37 +0000 (21:34 -0400)
commit1fe63a158ddedc3eb8f752e629889af0d6d3eb3b
tree29b1cb79b33be4fb1683268868b9ccc72dda9200
parenta5dd95f0bb2bbc3d4b6ea1e5ddd75f705a6ceadc
Sanity check cstore limit/offset param values

Certain cstore calls (direct / json_query) that support limit/offset
params called with a non-string / non-numeric value

e.g. { "limit": null }

result in a cstore segfault as it tries to call atoi(NULL) under the
covers.  This patch prevents this by verifying that the limit/offset
values are actual strings or numbers (i.e. return a value from
jsonObjectGetString) and not JSON_NULL, etc.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/c-apps/oils_sql.c