From 95533a4516fe3d9de56b7e6fa8ca798f06e26b03 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 15 Jan 2013 10:58:16 -0500 Subject: [PATCH] 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 --- Open-ILS/src/c-apps/oils_sql.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 ); -- 2.11.0