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:09:35 +0000 (00:09 -0400)
commit36b6bac7d00560e1fc4660e0fa0f1dcabd29a978
treebaf0d3103dd965d8fc76021d7184397ce50176c9
parent2d27819f41d851d3333919f1cbc05632cdba15f3
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