Sanity check cstore limit/offset param values user/berick/cstore-null-limit-segfault
authorBill Erickson <berick@esilibrary.com>
Thu, 16 Aug 2012 19:40:58 +0000 (15:40 -0400)
committerBill Erickson <berick@esilibrary.com>
Thu, 16 Aug 2012 19:52:18 +0000 (15:52 -0400)
commit303603b9137b9db564215c78b38b8d659a40cb98
treeecea7c19ac5c3f328b26e97053103d3785e2d343
parent1aec4ad62e29f454f910893571dc220008d0f2fc
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