[open-ils-commits] r12211 - trunk/Open-ILS/src/c-apps (scottmk)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Feb 17 18:19:21 EST 2009


Author: scottmk
Date: 2009-02-17 18:19:16 -0500 (Tue, 17 Feb 2009)
New Revision: 12211

Modified:
   trunk/Open-ILS/src/c-apps/oils_cstore.c
Log:
In searchJOIN(): added a bit of sanity checking, to prevent
segfaults induced by certain kinds of malformed JSOn queries.


Modified: trunk/Open-ILS/src/c-apps/oils_cstore.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_cstore.c	2009-02-17 22:57:37 UTC (rev 12210)
+++ trunk/Open-ILS/src/c-apps/oils_cstore.c	2009-02-17 23:19:16 UTC (rev 12211)
@@ -2011,8 +2011,17 @@
 		free(_tmp);
 		working_hash = freeable_hash;
 	}
-	else
+	else {
+		if( join_hash->type != JSON_HASH ) {
+			osrfLogError(
+				OSRF_LOG_MARK,
+				"%s: JOIN failed; expected JSON object type not found",
+				MODULENAME
+			);
+			return NULL;
+		}
 		working_hash = join_hash;
+	}
 
 	growing_buffer* join_buf = buffer_init(128);
 	const char* leftclass = osrfHashGet(leftmeta, "classname");



More information about the open-ils-commits mailing list