Sanity check cstore limit/offset param values
authorBill Erickson <berick@esilibrary.com>
Thu, 16 Aug 2012 19:40:58 +0000 (15:40 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 22 Aug 2012 18:47:37 +0000 (14:47 -0400)
commit0e10e2613a4bf92cabb9314bfe3f1029dc08f16f
treebb3028047a359ac5c8d21c54f2f0abd88643882b
parent01f1ea70d07de59e3c85af44b7c1a2f98cde0323
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: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/c-apps/oils_sql.c