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=120442a030e899340ebb768178d853684d3a9d21;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 59aa5b8001..033e265d2c 100644 --- a/Open-ILS/src/c-apps/oils_sql.c +++ b/Open-ILS/src/c-apps/oils_sql.c @@ -874,6 +874,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 );