080a160c7b9595d516c9c70e83689a09b60839d0 galt Mon Jun 3 12:16:53 2013 -0700 fix SQL Injection diff --git src/parasol/para/jobResult.c src/parasol/para/jobResult.c index c210034..d5d6eac 100644 --- src/parasol/para/jobResult.c +++ src/parasol/para/jobResult.c @@ -86,30 +86,32 @@ *resultBookMark = bookMark; return list; } #ifdef USING_SQL struct jobResult *jobResultLoadWhere(struct sqlConnection *conn, char *table, char *where) /* Load all jobResult from table that satisfy where clause. The * where clause may be NULL in which case whole table is loaded * Dispose of this with jobResultFreeList(). */ { struct jobResult *list = NULL, *el; struct dyString *query = dyStringNew(256); struct sqlResult *sr; char **row; +// should be changed to sqlDyStringPrintf for NOSQLINJ +// but that would perhaps require moving this code to someplace under hg/ ? dyStringPrintf(query, "select * from %s", table); if (where != NULL) dyStringPrintf(query, " where %s", where); sr = sqlGetResult(conn, query->string); while ((row = sqlNextRow(sr)) != NULL) { el = jobResultLoad(row); slAddHead(&list, el); } slReverse(&list); sqlFreeResult(&sr); dyStringFree(&query); return list; } #endif /* USEING_SQL */