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>
Sun, 19 Aug 2012 04:08:59 +0000 (00:08 -0400)
commitcd5d8657d0186196f5a274d32367f22fcc4fd6ba
tree2f9afe31eff64a634510878b48f3c073c3a7720f
parent30c9a360e74d7f91dd6af58f9ec5f57202fb1902
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>
Open-ILS/src/c-apps/oils_sql.c