Before we attempt to mangle the name, let's ensure that it's non-null.
Otherwise, segfaults ensue.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
// 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 );