From: Bill Erickson Date: Tue, 15 Jan 2013 15:58:16 +0000 (-0500) Subject: Verify savepoint name is non-null X-Git-Tag: sprint4-merge-nov22~3550 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=95533a4516fe3d9de56b7e6fa8ca798f06e26b03;p=working%2FEvergreen.git Verify savepoint name is non-null Before we attempt to mangle the name, let's ensure that it's non-null. Otherwise, segfaults ensue. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/c-apps/oils_sql.c b/Open-ILS/src/c-apps/oils_sql.c index d27c27274a..18b0f9c906 100644 --- a/Open-ILS/src/c-apps/oils_sql.c +++ b/Open-ILS/src/c-apps/oils_sql.c @@ -890,6 +890,12 @@ int setSavepoint( osrfMethodContext* ctx ) { // Get the savepoint name from the method params const char* spName = jsonObjectGetString( jsonObjectGetIndex(ctx->params, spNamePos) ); + + if (!spName) { + osrfLogWarning(OSRF_LOG_MARK, "savepoint.set called with no name"); + return -1; + } + char *safeSpName = _sanitize_savepoint_name( spName ); dbi_result result = dbi_conn_queryf( writehandle, "SAVEPOINT \"%s\";", safeSpName );