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:49:54 +0000 (14:49 -0400)
commit61329042eff1ef99d5b1a0a23758b7376f4ced2c
tree82d03fe2e4889f76c9d5be9bb086d78d9fabc7ae
parentbf52858f4f5da72bf0ddaec6db8720a53ce99969
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