From: Bill Erickson Date: Tue, 15 Jan 2013 15:58:16 +0000 (-0500) Subject: Verify savepoint name is non-null X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=03dc6c9417bb50bc8cb78d4b085dd2d41a5d0928;p=contrib%2FConifer.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 61d24a63ae..157c9eec01 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 );