idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
32,700 | int msPostGISLayerGetShape(layerObj *layer, shapeObj *shape, resultObj *record)
{
#ifdef USE_POSTGIS
PGresult *pgresult = NULL;
msPostGISLayerInfo *layerinfo = NULL;
long shapeindex = record->shapeindex;
int resultindex = record->resultindex;
assert(layer != NULL);
assert(layer->layerinfo != NULL);
if... | Exec Code Sql | 0 | int msPostGISLayerGetShape(layerObj *layer, shapeObj *shape, resultObj *record)
{
#ifdef USE_POSTGIS
PGresult *pgresult = NULL;
msPostGISLayerInfo *layerinfo = NULL;
long shapeindex = record->shapeindex;
int resultindex = record->resultindex;
assert(layer != NULL);
assert(layer->layerinfo != NULL);
if... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,701 | int msPostGISLayerInitItemInfo(layerObj *layer)
{
#ifdef USE_POSTGIS
int i;
int *itemindexes ;
if (layer->debug) {
msDebug("msPostGISLayerInitItemInfo called.\n");
}
if (layer->numitems == 0) {
return MS_SUCCESS;
}
if (layer->iteminfo) {
free(layer->iteminfo);
}
layer->iteminfo = msSma... | Exec Code Sql | 0 | int msPostGISLayerInitItemInfo(layerObj *layer)
{
#ifdef USE_POSTGIS
int i;
int *itemindexes ;
if (layer->debug) {
msDebug("msPostGISLayerInitItemInfo called.\n");
}
if (layer->numitems == 0) {
return MS_SUCCESS;
}
if (layer->iteminfo) {
free(layer->iteminfo);
}
layer->iteminfo = msSma... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,702 | int msPostGISLayerInitializeVirtualTable(layerObj *layer)
{
assert(layer != NULL);
assert(layer->vtable != NULL);
layer->vtable->LayerInitItemInfo = msPostGISLayerInitItemInfo;
layer->vtable->LayerFreeItemInfo = msPostGISLayerFreeItemInfo;
layer->vtable->LayerOpen = msPostGISLayerOpen;
layer->vtable->Layer... | Exec Code Sql | 0 | int msPostGISLayerInitializeVirtualTable(layerObj *layer)
{
assert(layer != NULL);
assert(layer->vtable != NULL);
layer->vtable->LayerInitItemInfo = msPostGISLayerInitItemInfo;
layer->vtable->LayerFreeItemInfo = msPostGISLayerFreeItemInfo;
layer->vtable->LayerOpen = msPostGISLayerOpen;
layer->vtable->Layer... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,703 | int msPostGISLayerIsOpen(layerObj *layer)
{
#ifdef USE_POSTGIS
if (layer->debug) {
msDebug("msPostGISLayerIsOpen called.\n");
}
if (layer->layerinfo)
return MS_TRUE;
else
return MS_FALSE;
#else
msSetError( MS_MISCERR,
"PostGIS support is not available.",
"msPostGISLay... | Exec Code Sql | 0 | int msPostGISLayerIsOpen(layerObj *layer)
{
#ifdef USE_POSTGIS
if (layer->debug) {
msDebug("msPostGISLayerIsOpen called.\n");
}
if (layer->layerinfo)
return MS_TRUE;
else
return MS_FALSE;
#else
msSetError( MS_MISCERR,
"PostGIS support is not available.",
"msPostGISLay... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,704 | int msPostGISLayerNextShape(layerObj *layer, shapeObj *shape)
{
#ifdef USE_POSTGIS
msPostGISLayerInfo *layerinfo;
if (layer->debug) {
msDebug("msPostGISLayerNextShape called.\n");
}
assert(layer != NULL);
assert(layer->layerinfo != NULL);
layerinfo = (msPostGISLayerInfo*) layer->layerinfo;
shape-... | Exec Code Sql | 0 | int msPostGISLayerNextShape(layerObj *layer, shapeObj *shape)
{
#ifdef USE_POSTGIS
msPostGISLayerInfo *layerinfo;
if (layer->debug) {
msDebug("msPostGISLayerNextShape called.\n");
}
assert(layer != NULL);
assert(layer->layerinfo != NULL);
layerinfo = (msPostGISLayerInfo*) layer->layerinfo;
shape-... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,705 | int msPostGISLayerOpen(layerObj *layer)
{
#ifdef USE_POSTGIS
msPostGISLayerInfo *layerinfo;
int order_test = 1;
assert(layer != NULL);
if (layer->debug) {
msDebug("msPostGISLayerOpen called: %s\n", layer->data);
}
if (layer->layerinfo) {
if (layer->debug) {
msDebug("msPostGISLayerOpen: Lay... | Exec Code Sql | 0 | int msPostGISLayerOpen(layerObj *layer)
{
#ifdef USE_POSTGIS
msPostGISLayerInfo *layerinfo;
int order_test = 1;
assert(layer != NULL);
if (layer->debug) {
msDebug("msPostGISLayerOpen called: %s\n", layer->data);
}
if (layer->layerinfo) {
if (layer->debug) {
msDebug("msPostGISLayerOpen: Lay... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,706 | int msPostGISLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery)
{
#ifdef USE_POSTGIS
msPostGISLayerInfo *layerinfo = NULL;
char *strSQL = NULL;
PGresult *pgresult = NULL;
char** layer_bind_values = (char**)msSmallMalloc(sizeof(char*) * 1000);
char* bind_value;
char* bind_key = (char*)msSmallMalloc... | Exec Code Sql | 0 | int msPostGISLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery)
{
#ifdef USE_POSTGIS
msPostGISLayerInfo *layerinfo = NULL;
char *strSQL = NULL;
PGresult *pgresult = NULL;
char** layer_bind_values = (char**)msSmallMalloc(sizeof(char*) * 1000);
char* bind_value;
char* bind_key = (char*)msSmallMalloc... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,707 | int msPostGISParseData(layerObj *layer)
{
char *pos_opt, *pos_scn, *tmp, *pos_srid, *pos_uid, *pos_geom, *data;
int slength;
msPostGISLayerInfo *layerinfo;
assert(layer != NULL);
assert(layer->layerinfo != NULL);
layerinfo = (msPostGISLayerInfo*)(layer->layerinfo);
if (layer->debug) {
msDebug("msPo... | Exec Code Sql | 0 | int msPostGISParseData(layerObj *layer)
{
char *pos_opt, *pos_scn, *tmp, *pos_srid, *pos_uid, *pos_geom, *data;
int slength;
msPostGISLayerInfo *layerinfo;
assert(layer != NULL);
assert(layer->layerinfo != NULL);
layerinfo = (msPostGISLayerInfo*)(layer->layerinfo);
if (layer->debug) {
msDebug("msPo... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,708 | msPostGISPassThroughFieldDefinitions( layerObj *layer,
PGresult *pgresult )
{
int i, numitems = PQnfields(pgresult);
msPostGISLayerInfo *layerinfo = layer->layerinfo;
for(i=0; i<numitems; i++) {
int oid, fmod;
const char *gml_type = "Character";
const char *item... | Exec Code Sql | 0 | msPostGISPassThroughFieldDefinitions( layerObj *layer,
PGresult *pgresult )
{
int i, numitems = PQnfields(pgresult);
msPostGISLayerInfo *layerinfo = layer->layerinfo;
for(i=0; i<numitems; i++) {
int oid, fmod;
const char *gml_type = "Character";
const char *item... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,709 | static char *msPostGISReplaceBoxToken(layerObj *layer, rectObj *rect, const char *fromsource)
{
char *result = NULL;
if ( strstr(fromsource, BOXTOKEN) && rect ) {
char *strBox = NULL;
char *strSRID = NULL;
/* We see to set the SRID on the box, but to what SRID? */
strSRID = msPostGISBuildSQLSRID(l... | Exec Code Sql | 0 | static char *msPostGISReplaceBoxToken(layerObj *layer, rectObj *rect, const char *fromsource)
{
char *result = NULL;
if ( strstr(fromsource, BOXTOKEN) && rect ) {
char *strBox = NULL;
char *strSRID = NULL;
/* We see to set the SRID on the box, but to what SRID? */
strSRID = msPostGISBuildSQLSRID(l... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,710 | msPostGISRetrievePK(layerObj *layer)
{
PGresult *pgresult = NULL;
char *sql = 0;
size_t size;
msPostGISLayerInfo *layerinfo = 0;
int length;
int pgVersion;
char *pos_sep;
char *schema = NULL;
char *table = NULL;
if (layer->debug) {
msDebug("msPostGISRetrievePK called.\n");
}
layerinfo = (m... | Exec Code Sql | 0 | msPostGISRetrievePK(layerObj *layer)
{
PGresult *pgresult = NULL;
char *sql = 0;
size_t size;
msPostGISLayerInfo *layerinfo = 0;
int length;
int pgVersion;
char *pos_sep;
char *schema = NULL;
char *table = NULL;
if (layer->debug) {
msDebug("msPostGISRetrievePK called.\n");
}
layerinfo = (m... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,711 | msPostGISRetrievePgVersion(PGconn *pgconn)
{
#ifndef POSTGIS_HAS_SERVER_VERSION
int pgVersion = 0;
char *strVersion = NULL;
char *strParts[3] = { NULL, NULL, NULL };
int i = 0, j = 0, len = 0;
int factor = 10000;
if (pgconn == NULL) {
msSetError(MS_QUERYERR, "Layer does not have a postgis connection.",... | Exec Code Sql | 0 | msPostGISRetrievePgVersion(PGconn *pgconn)
{
#ifndef POSTGIS_HAS_SERVER_VERSION
int pgVersion = 0;
char *strVersion = NULL;
char *strParts[3] = { NULL, NULL, NULL };
int i = 0, j = 0, len = 0;
int factor = 10000;
if (pgconn == NULL) {
msSetError(MS_QUERYERR, "Layer does not have a postgis connection.",... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,712 | msPostGISRetrieveVersion(PGconn *pgconn)
{
static char* sql = "SELECT postgis_version()";
int version = 0;
size_t strSize;
char *strVersion = NULL;
char *ptr;
char *strParts[3] = { NULL, NULL, NULL };
int i = 0, j = 0;
int factor = 10000;
PGresult *pgresult = NULL;
if ( ! pgconn ) {
msSetError(... | Exec Code Sql | 0 | msPostGISRetrieveVersion(PGconn *pgconn)
{
static char* sql = "SELECT postgis_version()";
int version = 0;
size_t strSize;
char *strVersion = NULL;
char *ptr;
char *strParts[3] = { NULL, NULL, NULL };
int i = 0, j = 0;
int factor = 10000;
PGresult *pgresult = NULL;
if ( ! pgconn ) {
msSetError(... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,713 | pointArrayAddPoint(pointArrayObj *d, const pointObj *p)
{
if ( !p || !d ) return MS_FAILURE;
/* Avoid overwriting memory buffer */
if ( d->maxpoints - d->npoints == 0 ) {
d->maxpoints *= 2;
d->data = realloc(d->data, d->maxpoints * sizeof(pointObj));
}
d->data[d->npoints] = *p;
d->npoints++;
retur... | Exec Code Sql | 0 | pointArrayAddPoint(pointArrayObj *d, const pointObj *p)
{
if ( !p || !d ) return MS_FAILURE;
/* Avoid overwriting memory buffer */
if ( d->maxpoints - d->npoints == 0 ) {
d->maxpoints *= 2;
d->data = realloc(d->data, d->maxpoints * sizeof(pointObj));
}
d->data[d->npoints] = *p;
d->npoints++;
retur... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,714 | pointArrayFree(pointArrayObj *d)
{
if ( ! d ) return;
if ( d->data ) free(d->data);
free(d);
}
| Exec Code Sql | 0 | pointArrayFree(pointArrayObj *d)
{
if ( ! d ) return;
if ( d->data ) free(d->data);
free(d);
}
| @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,715 | pointArrayNew(int maxpoints)
{
pointArrayObj *d = msSmallMalloc(sizeof(pointArrayObj));
if ( maxpoints < 1 ) maxpoints = 1; /* Avoid a degenerate case */
d->maxpoints = maxpoints;
d->data = msSmallMalloc(maxpoints * sizeof(pointObj));
d->npoints = 0;
return d;
}
| Exec Code Sql | 0 | pointArrayNew(int maxpoints)
{
pointArrayObj *d = msSmallMalloc(sizeof(pointArrayObj));
if ( maxpoints < 1 ) maxpoints = 1; /* Avoid a degenerate case */
d->maxpoints = maxpoints;
d->data = msSmallMalloc(maxpoints * sizeof(pointObj));
d->npoints = 0;
return d;
}
| @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,716 | int postgresTimeStampForTimeString(const char *timestring, char *dest, size_t destsize)
{
int nlength = strlen(timestring);
int timeresolution = msTimeGetResolution(timestring);
int bNoDate = (*timestring == 'T');
if (timeresolution < 0)
return MS_FALSE;
switch(timeresolution) {
case TIME_RESOLUTION_... | Exec Code Sql | 0 | int postgresTimeStampForTimeString(const char *timestring, char *dest, size_t destsize)
{
int nlength = strlen(timestring);
int timeresolution = msTimeGetResolution(timestring);
int bNoDate = (*timestring == 'T');
if (timeresolution < 0)
return MS_FALSE;
switch(timeresolution) {
case TIME_RESOLUTION_... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,717 | void postresqlNoticeHandler(void *arg, const char *message)
{
layerObj *lp;
lp = (layerObj*)arg;
if (lp->debug) {
msDebug("%s\n", message);
}
}
| Exec Code Sql | 0 | void postresqlNoticeHandler(void *arg, const char *message)
{
layerObj *lp;
lp = (layerObj*)arg;
if (lp->debug) {
msDebug("%s\n", message);
}
}
| @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,718 | wkbCollectionSubType(wkbObj *w)
{
int t;
memcpy(&t, (w->ptr + 1 + 4 + 4 + 1), sizeof(int));
return wkbTypeMap(w,t);
}
| Exec Code Sql | 0 | wkbCollectionSubType(wkbObj *w)
{
int t;
memcpy(&t, (w->ptr + 1 + 4 + 4 + 1), sizeof(int));
return wkbTypeMap(w,t);
}
| @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,719 | wkbConvCircularStringToShape(wkbObj *w, shapeObj *shape)
{
int type;
lineObj line = {0, NULL};
/*endian = */wkbReadChar(w);
type = wkbTypeMap(w,wkbReadInt(w));
if( type != WKB_CIRCULARSTRING ) return MS_FAILURE;
/* Stroke the string into a point array */
if ( arcStrokeCircularString(w, SEGMENT_ANGLE, &... | Exec Code Sql | 0 | wkbConvCircularStringToShape(wkbObj *w, shapeObj *shape)
{
int type;
lineObj line = {0, NULL};
/*endian = */wkbReadChar(w);
type = wkbTypeMap(w,wkbReadInt(w));
if( type != WKB_CIRCULARSTRING ) return MS_FAILURE;
/* Stroke the string into a point array */
if ( arcStrokeCircularString(w, SEGMENT_ANGLE, &... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,720 | wkbConvCollectionToShape(wkbObj *w, shapeObj *shape)
{
int i, ncomponents;
int failures = 0;
/*endian = */wkbReadChar(w);
/*type = */wkbTypeMap(w,wkbReadInt(w));
ncomponents = wkbReadInt(w);
/*
* If we can draw any portion of the collection, we will,
* but if all the components fail, we will draw noth... | Exec Code Sql | 0 | wkbConvCollectionToShape(wkbObj *w, shapeObj *shape)
{
int i, ncomponents;
int failures = 0;
/*endian = */wkbReadChar(w);
/*type = */wkbTypeMap(w,wkbReadInt(w));
ncomponents = wkbReadInt(w);
/*
* If we can draw any portion of the collection, we will,
* but if all the components fail, we will draw noth... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,721 | wkbConvCompoundCurveToShape(wkbObj *w, shapeObj *shape)
{
int npoints = 0;
int type, ncomponents, i, j;
lineObj *line;
shapeObj shapebuf;
/*endian = */wkbReadChar(w);
type = wkbTypeMap(w,wkbReadInt(w));
/* Init our shape buffer */
msInitShape(&shapebuf);
if( type != WKB_COMPOUNDCURVE ) return MS_FA... | Exec Code Sql | 0 | wkbConvCompoundCurveToShape(wkbObj *w, shapeObj *shape)
{
int npoints = 0;
int type, ncomponents, i, j;
lineObj *line;
shapeObj shapebuf;
/*endian = */wkbReadChar(w);
type = wkbTypeMap(w,wkbReadInt(w));
/* Init our shape buffer */
msInitShape(&shapebuf);
if( type != WKB_COMPOUNDCURVE ) return MS_FA... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,722 | wkbConvGeometryToShape(wkbObj *w, shapeObj *shape)
{
int wkbtype = wkbType(w); /* Peak at the type number */
switch(wkbtype) {
/* Recurse into anonymous collections */
case WKB_GEOMETRYCOLLECTION:
return wkbConvCollectionToShape(w, shape);
/* Handle area types */
case WKB_POLYGON:
r... | Exec Code Sql | 0 | wkbConvGeometryToShape(wkbObj *w, shapeObj *shape)
{
int wkbtype = wkbType(w); /* Peak at the type number */
switch(wkbtype) {
/* Recurse into anonymous collections */
case WKB_GEOMETRYCOLLECTION:
return wkbConvCollectionToShape(w, shape);
/* Handle area types */
case WKB_POLYGON:
r... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,723 | wkbConvLineStringToShape(wkbObj *w, shapeObj *shape)
{
int type;
lineObj line;
/*endian = */wkbReadChar(w);
type = wkbTypeMap(w,wkbReadInt(w));
if( type != WKB_LINESTRING ) return MS_FAILURE;
wkbReadLine(w,&line);
msAddLineDirectly(shape, &line);
return MS_SUCCESS;
}
| Exec Code Sql | 0 | wkbConvLineStringToShape(wkbObj *w, shapeObj *shape)
{
int type;
lineObj line;
/*endian = */wkbReadChar(w);
type = wkbTypeMap(w,wkbReadInt(w));
if( type != WKB_LINESTRING ) return MS_FAILURE;
wkbReadLine(w,&line);
msAddLineDirectly(shape, &line);
return MS_SUCCESS;
}
| @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,724 | wkbConvPointToShape(wkbObj *w, shapeObj *shape)
{
int type;
lineObj line;
/*endian = */wkbReadChar(w);
type = wkbTypeMap(w,wkbReadInt(w));
if( type != WKB_POINT ) return MS_FAILURE;
if( ! (shape->type == MS_SHAPE_POINT) ) return MS_FAILURE;
line.numpoints = 1;
line.point = msSmallMalloc(sizeof(pointO... | Exec Code Sql | 0 | wkbConvPointToShape(wkbObj *w, shapeObj *shape)
{
int type;
lineObj line;
/*endian = */wkbReadChar(w);
type = wkbTypeMap(w,wkbReadInt(w));
if( type != WKB_POINT ) return MS_FAILURE;
if( ! (shape->type == MS_SHAPE_POINT) ) return MS_FAILURE;
line.numpoints = 1;
line.point = msSmallMalloc(sizeof(pointO... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,725 | wkbConvPolygonToShape(wkbObj *w, shapeObj *shape)
{
int type;
int i, nrings;
lineObj line;
/*endian = */wkbReadChar(w);
type = wkbTypeMap(w,wkbReadInt(w));
if( type != WKB_POLYGON ) return MS_FAILURE;
/* How many rings? */
nrings = wkbReadInt(w);
/* Add each ring to the shape */
for( i = 0; i < ... | Exec Code Sql | 0 | wkbConvPolygonToShape(wkbObj *w, shapeObj *shape)
{
int type;
int i, nrings;
lineObj line;
/*endian = */wkbReadChar(w);
type = wkbTypeMap(w,wkbReadInt(w));
if( type != WKB_POLYGON ) return MS_FAILURE;
/* How many rings? */
nrings = wkbReadInt(w);
/* Add each ring to the shape */
for( i = 0; i < ... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,726 | wkbReadChar(wkbObj *w)
{
char c;
memcpy(&c, w->ptr, sizeof(char));
w->ptr += sizeof(char);
return c;
}
| Exec Code Sql | 0 | wkbReadChar(wkbObj *w)
{
char c;
memcpy(&c, w->ptr, sizeof(char));
w->ptr += sizeof(char);
return c;
}
| @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,727 | wkbReadDouble(wkbObj *w)
{
double d;
memcpy(&d, w->ptr, sizeof(double));
w->ptr += sizeof(double);
return d;
}
| Exec Code Sql | 0 | wkbReadDouble(wkbObj *w)
{
double d;
memcpy(&d, w->ptr, sizeof(double));
w->ptr += sizeof(double);
return d;
}
| @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,728 | wkbReadInt(wkbObj *w)
{
int i;
memcpy(&i, w->ptr, sizeof(int));
w->ptr += sizeof(int);
return i;
}
| Exec Code Sql | 0 | wkbReadInt(wkbObj *w)
{
int i;
memcpy(&i, w->ptr, sizeof(int));
w->ptr += sizeof(int);
return i;
}
| @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,729 | wkbReadLine(wkbObj *w, lineObj *line)
{
int i;
pointObj p;
int npoints = wkbReadInt(w);
line->numpoints = npoints;
line->point = msSmallMalloc(npoints * sizeof(pointObj));
for ( i = 0; i < npoints; i++ ) {
wkbReadPointP(w, &p);
line->point[i] = p;
}
}
| Exec Code Sql | 0 | wkbReadLine(wkbObj *w, lineObj *line)
{
int i;
pointObj p;
int npoints = wkbReadInt(w);
line->numpoints = npoints;
line->point = msSmallMalloc(npoints * sizeof(pointObj));
for ( i = 0; i < npoints; i++ ) {
wkbReadPointP(w, &p);
line->point[i] = p;
}
}
| @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,730 | wkbReadPoint(wkbObj *w)
{
pointObj p;
wkbReadPointP(w, &p);
return p;
}
| Exec Code Sql | 0 | wkbReadPoint(wkbObj *w)
{
pointObj p;
wkbReadPointP(w, &p);
return p;
}
| @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,731 | wkbReadPointP(wkbObj *w, pointObj *p)
{
memcpy(&(p->x), w->ptr, sizeof(double));
w->ptr += sizeof(double);
memcpy(&(p->y), w->ptr, sizeof(double));
w->ptr += sizeof(double);
}
| Exec Code Sql | 0 | wkbReadPointP(wkbObj *w, pointObj *p)
{
memcpy(&(p->x), w->ptr, sizeof(double));
w->ptr += sizeof(double);
memcpy(&(p->y), w->ptr, sizeof(double));
w->ptr += sizeof(double);
}
| @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,732 | wkbSkipGeometry(wkbObj *w)
{
int type, npoints, nrings, ngeoms, i;
/*endian = */wkbReadChar(w);
type = wkbTypeMap(w,wkbReadInt(w));
switch(type) {
case WKB_POINT:
w->ptr += 2 * sizeof(double);
break;
case WKB_CIRCULARSTRING:
case WKB_LINESTRING:
npoints = wkbReadInt(w);
w->pt... | Exec Code Sql | 0 | wkbSkipGeometry(wkbObj *w)
{
int type, npoints, nrings, ngeoms, i;
/*endian = */wkbReadChar(w);
type = wkbTypeMap(w,wkbReadInt(w));
switch(type) {
case WKB_POINT:
w->ptr += 2 * sizeof(double);
break;
case WKB_CIRCULARSTRING:
case WKB_LINESTRING:
npoints = wkbReadInt(w);
w->pt... | @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,733 | wkbType(wkbObj *w)
{
int t;
memcpy(&t, (w->ptr + 1), sizeof(int));
return wkbTypeMap(w,t);
}
| Exec Code Sql | 0 | wkbType(wkbObj *w)
{
int t;
memcpy(&t, (w->ptr + 1), sizeof(int));
return wkbTypeMap(w,t);
}
| @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,734 | wkbTypeMap(wkbObj *w, int type)
{
if ( type < WKB_TYPE_COUNT )
return w->typemap[type];
else
return 0;
}
| Exec Code Sql | 0 | wkbTypeMap(wkbObj *w, int type)
{
if ( type < WKB_TYPE_COUNT )
return w->typemap[type];
else
return 0;
}
| @@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
if (!lp || !timestring || !timefield)
return MS_FALSE;
+ if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
+ msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
+... | CWE-89 | null | null |
32,735 | void hashtable_close(hashtable_t *hashtable)
{
hashtable_do_clear(hashtable);
jsonp_free(hashtable->buckets);
}
| DoS | 0 | void hashtable_close(hashtable_t *hashtable)
{
hashtable_do_clear(hashtable);
jsonp_free(hashtable->buckets);
}
| @@ -5,8 +5,17 @@
* it under the terms of the MIT license. See LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include <jansson_config.h> /* for JSON_INLINE */
#include "jansson_private.h" ... | CWE-310 | null | null |
32,736 | int hashtable_del(hashtable_t *hashtable, const char *key)
{
size_t hash = hash_str(key);
return hashtable_do_del(hashtable, key, hash);
}
| DoS | 0 | int hashtable_del(hashtable_t *hashtable, const char *key)
{
size_t hash = hash_str(key);
return hashtable_do_del(hashtable, key, hash);
}
| @@ -5,8 +5,17 @@
* it under the terms of the MIT license. See LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include <jansson_config.h> /* for JSON_INLINE */
#include "jansson_private.h" ... | CWE-310 | null | null |
32,737 | static pair_t *hashtable_find_pair(hashtable_t *hashtable, bucket_t *bucket,
const char *key, size_t hash)
{
list_t *list;
pair_t *pair;
if(bucket_is_empty(hashtable, bucket))
return NULL;
list = bucket->first;
while(1)
{
pair = list_to_pai... | DoS | 0 | static pair_t *hashtable_find_pair(hashtable_t *hashtable, bucket_t *bucket,
const char *key, size_t hash)
{
list_t *list;
pair_t *pair;
if(bucket_is_empty(hashtable, bucket))
return NULL;
list = bucket->first;
while(1)
{
pair = list_to_pai... | @@ -5,8 +5,17 @@
* it under the terms of the MIT license. See LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include <jansson_config.h> /* for JSON_INLINE */
#include "jansson_private.h" ... | CWE-310 | null | null |
32,738 | void *hashtable_iter(hashtable_t *hashtable)
{
return hashtable_iter_next(hashtable, &hashtable->list);
}
| DoS | 0 | void *hashtable_iter(hashtable_t *hashtable)
{
return hashtable_iter_next(hashtable, &hashtable->list);
}
| @@ -5,8 +5,17 @@
* it under the terms of the MIT license. See LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include <jansson_config.h> /* for JSON_INLINE */
#include "jansson_private.h" ... | CWE-310 | null | null |
32,739 | void *hashtable_iter_next(hashtable_t *hashtable, void *iter)
{
list_t *list = (list_t *)iter;
if(list->next == &hashtable->list)
return NULL;
return list->next;
}
| DoS | 0 | void *hashtable_iter_next(hashtable_t *hashtable, void *iter)
{
list_t *list = (list_t *)iter;
if(list->next == &hashtable->list)
return NULL;
return list->next;
}
| @@ -5,8 +5,17 @@
* it under the terms of the MIT license. See LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include <jansson_config.h> /* for JSON_INLINE */
#include "jansson_private.h" ... | CWE-310 | null | null |
32,740 | size_t hashtable_iter_serial(void *iter)
{
pair_t *pair = list_to_pair((list_t *)iter);
return pair->serial;
}
| DoS | 0 | size_t hashtable_iter_serial(void *iter)
{
pair_t *pair = list_to_pair((list_t *)iter);
return pair->serial;
}
| @@ -5,8 +5,17 @@
* it under the terms of the MIT license. See LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include <jansson_config.h> /* for JSON_INLINE */
#include "jansson_private.h" ... | CWE-310 | null | null |
32,741 | void hashtable_iter_set(void *iter, json_t *value)
{
pair_t *pair = list_to_pair((list_t *)iter);
json_decref(pair->value);
pair->value = value;
}
| DoS | 0 | void hashtable_iter_set(void *iter, json_t *value)
{
pair_t *pair = list_to_pair((list_t *)iter);
json_decref(pair->value);
pair->value = value;
}
| @@ -5,8 +5,17 @@
* it under the terms of the MIT license. See LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include <jansson_config.h> /* for JSON_INLINE */
#include "jansson_private.h" ... | CWE-310 | null | null |
32,742 | static void insert_to_bucket(hashtable_t *hashtable, bucket_t *bucket,
list_t *list)
{
if(bucket_is_empty(hashtable, bucket))
{
list_insert(&hashtable->list, list);
bucket->first = bucket->last = list;
}
else
{
list_insert(bucket->first, list);
... | DoS | 0 | static void insert_to_bucket(hashtable_t *hashtable, bucket_t *bucket,
list_t *list)
{
if(bucket_is_empty(hashtable, bucket))
{
list_insert(&hashtable->list, list);
bucket->first = bucket->last = list;
}
else
{
list_insert(bucket->first, list);
... | @@ -5,8 +5,17 @@
* it under the terms of the MIT license. See LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include <jansson_config.h> /* for JSON_INLINE */
#include "jansson_private.h" ... | CWE-310 | null | null |
32,743 | static JSON_INLINE void list_init(list_t *list)
{
list->next = list;
list->prev = list;
}
| DoS | 0 | static JSON_INLINE void list_init(list_t *list)
{
list->next = list;
list->prev = list;
}
| @@ -5,8 +5,17 @@
* it under the terms of the MIT license. See LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include <jansson_config.h> /* for JSON_INLINE */
#include "jansson_private.h" ... | CWE-310 | null | null |
32,744 | static JSON_INLINE void list_insert(list_t *list, list_t *node)
{
node->next = list;
node->prev = list->prev;
list->prev->next = node;
list->prev = node;
}
| DoS | 0 | static JSON_INLINE void list_insert(list_t *list, list_t *node)
{
node->next = list;
node->prev = list->prev;
list->prev->next = node;
list->prev = node;
}
| @@ -5,8 +5,17 @@
* it under the terms of the MIT license. See LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include <jansson_config.h> /* for JSON_INLINE */
#include "jansson_private.h" ... | CWE-310 | null | null |
32,745 | static JSON_INLINE void list_remove(list_t *list)
{
list->prev->next = list->next;
list->next->prev = list->prev;
}
| DoS | 0 | static JSON_INLINE void list_remove(list_t *list)
{
list->prev->next = list->next;
list->next->prev = list->prev;
}
| @@ -5,8 +5,17 @@
* it under the terms of the MIT license. See LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include <jansson_config.h> /* for JSON_INLINE */
#include "jansson_private.h" ... | CWE-310 | null | null |
32,746 | static void array_copy(json_t **dest, size_t dpos,
json_t **src, size_t spos,
size_t count)
{
memcpy(&dest[dpos], &src[spos], count * sizeof(json_t *));
}
| DoS | 0 | static void array_copy(json_t **dest, size_t dpos,
json_t **src, size_t spos,
size_t count)
{
memcpy(&dest[dpos], &src[spos], count * sizeof(json_t *));
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,747 | static void array_move(json_array_t *array, size_t dest,
size_t src, size_t count)
{
memmove(&array->table[dest], &array->table[src], count * sizeof(json_t *));
}
| DoS | 0 | static void array_move(json_array_t *array, size_t dest,
size_t src, size_t count)
{
memmove(&array->table[dest], &array->table[src], count * sizeof(json_t *));
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,748 | static JSON_INLINE int isinf(double x) { return !isnan(x) && isnan(x - x); }
| DoS | 0 | static JSON_INLINE int isinf(double x) { return !isnan(x) && isnan(x - x); }
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,749 | int json_array_clear(json_t *json)
{
json_array_t *array;
size_t i;
if(!json_is_array(json))
return -1;
array = json_to_array(json);
for(i = 0; i < array->entries; i++)
json_decref(array->table[i]);
array->entries = 0;
return 0;
}
| DoS | 0 | int json_array_clear(json_t *json)
{
json_array_t *array;
size_t i;
if(!json_is_array(json))
return -1;
array = json_to_array(json);
for(i = 0; i < array->entries; i++)
json_decref(array->table[i]);
array->entries = 0;
return 0;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,750 | static json_t *json_array_copy(json_t *array)
{
json_t *result;
size_t i;
result = json_array();
if(!result)
return NULL;
for(i = 0; i < json_array_size(array); i++)
json_array_append(result, json_array_get(array, i));
return result;
}
| DoS | 0 | static json_t *json_array_copy(json_t *array)
{
json_t *result;
size_t i;
result = json_array();
if(!result)
return NULL;
for(i = 0; i < json_array_size(array); i++)
json_array_append(result, json_array_get(array, i));
return result;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,751 | static json_t *json_array_deep_copy(const json_t *array)
{
json_t *result;
size_t i;
result = json_array();
if(!result)
return NULL;
for(i = 0; i < json_array_size(array); i++)
json_array_append_new(result, json_deep_copy(json_array_get(array, i)));
return result;
}
| DoS | 0 | static json_t *json_array_deep_copy(const json_t *array)
{
json_t *result;
size_t i;
result = json_array();
if(!result)
return NULL;
for(i = 0; i < json_array_size(array); i++)
json_array_append_new(result, json_deep_copy(json_array_get(array, i)));
return result;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,752 | static int json_array_equal(json_t *array1, json_t *array2)
{
size_t i, size;
size = json_array_size(array1);
if(size != json_array_size(array2))
return 0;
for(i = 0; i < size; i++)
{
json_t *value1, *value2;
value1 = json_array_get(array1, i);
value2 = json_array_... | DoS | 0 | static int json_array_equal(json_t *array1, json_t *array2)
{
size_t i, size;
size = json_array_size(array1);
if(size != json_array_size(array2))
return 0;
for(i = 0; i < size; i++)
{
json_t *value1, *value2;
value1 = json_array_get(array1, i);
value2 = json_array_... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,753 | int json_array_extend(json_t *json, json_t *other_json)
{
json_array_t *array, *other;
size_t i;
if(!json_is_array(json) || !json_is_array(other_json))
return -1;
array = json_to_array(json);
other = json_to_array(other_json);
if(!json_array_grow(array, other->entries, 1))
retu... | DoS | 0 | int json_array_extend(json_t *json, json_t *other_json)
{
json_array_t *array, *other;
size_t i;
if(!json_is_array(json) || !json_is_array(other_json))
return -1;
array = json_to_array(json);
other = json_to_array(other_json);
if(!json_array_grow(array, other->entries, 1))
retu... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,754 | json_t *json_array_get(const json_t *json, size_t index)
{
json_array_t *array;
if(!json_is_array(json))
return NULL;
array = json_to_array(json);
if(index >= array->entries)
return NULL;
return array->table[index];
}
| DoS | 0 | json_t *json_array_get(const json_t *json, size_t index)
{
json_array_t *array;
if(!json_is_array(json))
return NULL;
array = json_to_array(json);
if(index >= array->entries)
return NULL;
return array->table[index];
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,755 | static json_t **json_array_grow(json_array_t *array,
size_t amount,
int copy)
{
size_t new_size;
json_t **old_table, **new_table;
if(array->entries + amount <= array->size)
return array->table;
old_table = array->table;
new_s... | DoS | 0 | static json_t **json_array_grow(json_array_t *array,
size_t amount,
int copy)
{
size_t new_size;
json_t **old_table, **new_table;
if(array->entries + amount <= array->size)
return array->table;
old_table = array->table;
new_s... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,756 | int json_array_insert_new(json_t *json, size_t index, json_t *value)
{
json_array_t *array;
json_t **old_table;
if(!value)
return -1;
if(!json_is_array(json) || json == value) {
json_decref(value);
return -1;
}
array = json_to_array(json);
if(index > array->entries... | DoS | 0 | int json_array_insert_new(json_t *json, size_t index, json_t *value)
{
json_array_t *array;
json_t **old_table;
if(!value)
return -1;
if(!json_is_array(json) || json == value) {
json_decref(value);
return -1;
}
array = json_to_array(json);
if(index > array->entries... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,757 | int json_array_remove(json_t *json, size_t index)
{
json_array_t *array;
if(!json_is_array(json))
return -1;
array = json_to_array(json);
if(index >= array->entries)
return -1;
json_decref(array->table[index]);
/* If we're removing the last element, nothing has to be moved */... | DoS | 0 | int json_array_remove(json_t *json, size_t index)
{
json_array_t *array;
if(!json_is_array(json))
return -1;
array = json_to_array(json);
if(index >= array->entries)
return -1;
json_decref(array->table[index]);
/* If we're removing the last element, nothing has to be moved */... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,758 | int json_array_set_new(json_t *json, size_t index, json_t *value)
{
json_array_t *array;
if(!value)
return -1;
if(!json_is_array(json) || json == value)
{
json_decref(value);
return -1;
}
array = json_to_array(json);
if(index >= array->entries)
{
json_d... | DoS | 0 | int json_array_set_new(json_t *json, size_t index, json_t *value)
{
json_array_t *array;
if(!value)
return -1;
if(!json_is_array(json) || json == value)
{
json_decref(value);
return -1;
}
array = json_to_array(json);
if(index >= array->entries)
{
json_d... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,759 | size_t json_array_size(const json_t *json)
{
if(!json_is_array(json))
return 0;
return json_to_array(json)->entries;
}
| DoS | 0 | size_t json_array_size(const json_t *json)
{
if(!json_is_array(json))
return 0;
return json_to_array(json)->entries;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,760 | json_t *json_copy(json_t *json)
{
if(!json)
return NULL;
if(json_is_object(json))
return json_object_copy(json);
if(json_is_array(json))
return json_array_copy(json);
if(json_is_string(json))
return json_string_copy(json);
if(json_is_integer(json))
return ... | DoS | 0 | json_t *json_copy(json_t *json)
{
if(!json)
return NULL;
if(json_is_object(json))
return json_object_copy(json);
if(json_is_array(json))
return json_array_copy(json);
if(json_is_string(json))
return json_string_copy(json);
if(json_is_integer(json))
return ... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,761 | json_t *json_deep_copy(const json_t *json)
{
if(!json)
return NULL;
if(json_is_object(json))
return json_object_deep_copy(json);
if(json_is_array(json))
return json_array_deep_copy(json);
/* for the rest of the types, deep copying doesn't differ from
shallow copying */
... | DoS | 0 | json_t *json_deep_copy(const json_t *json)
{
if(!json)
return NULL;
if(json_is_object(json))
return json_object_deep_copy(json);
if(json_is_array(json))
return json_array_deep_copy(json);
/* for the rest of the types, deep copying doesn't differ from
shallow copying */
... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,762 | void json_delete(json_t *json)
{
if(json_is_object(json))
json_delete_object(json_to_object(json));
else if(json_is_array(json))
json_delete_array(json_to_array(json));
else if(json_is_string(json))
json_delete_string(json_to_string(json));
else if(json_is_integer(json))
... | DoS | 0 | void json_delete(json_t *json)
{
if(json_is_object(json))
json_delete_object(json_to_object(json));
else if(json_is_array(json))
json_delete_array(json_to_array(json));
else if(json_is_string(json))
json_delete_string(json_to_string(json));
else if(json_is_integer(json))
... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,763 | static void json_delete_array(json_array_t *array)
{
size_t i;
for(i = 0; i < array->entries; i++)
json_decref(array->table[i]);
jsonp_free(array->table);
jsonp_free(array);
}
| DoS | 0 | static void json_delete_array(json_array_t *array)
{
size_t i;
for(i = 0; i < array->entries; i++)
json_decref(array->table[i]);
jsonp_free(array->table);
jsonp_free(array);
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,764 | static void json_delete_integer(json_integer_t *integer)
{
jsonp_free(integer);
}
| DoS | 0 | static void json_delete_integer(json_integer_t *integer)
{
jsonp_free(integer);
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,765 | static void json_delete_object(json_object_t *object)
{
hashtable_close(&object->hashtable);
jsonp_free(object);
}
| DoS | 0 | static void json_delete_object(json_object_t *object)
{
hashtable_close(&object->hashtable);
jsonp_free(object);
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,766 | static void json_delete_real(json_real_t *real)
{
jsonp_free(real);
}
| DoS | 0 | static void json_delete_real(json_real_t *real)
{
jsonp_free(real);
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,767 | static void json_delete_string(json_string_t *string)
{
jsonp_free(string->value);
jsonp_free(string);
}
| DoS | 0 | static void json_delete_string(json_string_t *string)
{
jsonp_free(string->value);
jsonp_free(string);
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,768 | json_t *json_false(void)
{
static json_t the_false = {JSON_FALSE, (size_t)-1};
return &the_false;
}
| DoS | 0 | json_t *json_false(void)
{
static json_t the_false = {JSON_FALSE, (size_t)-1};
return &the_false;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,769 | json_t *json_integer(json_int_t value)
{
json_integer_t *integer = jsonp_malloc(sizeof(json_integer_t));
if(!integer)
return NULL;
json_init(&integer->json, JSON_INTEGER);
integer->value = value;
return &integer->json;
}
| DoS | 0 | json_t *json_integer(json_int_t value)
{
json_integer_t *integer = jsonp_malloc(sizeof(json_integer_t));
if(!integer)
return NULL;
json_init(&integer->json, JSON_INTEGER);
integer->value = value;
return &integer->json;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,770 | static json_t *json_integer_copy(const json_t *integer)
{
return json_integer(json_integer_value(integer));
}
| DoS | 0 | static json_t *json_integer_copy(const json_t *integer)
{
return json_integer(json_integer_value(integer));
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,771 | int json_integer_set(json_t *json, json_int_t value)
{
if(!json_is_integer(json))
return -1;
json_to_integer(json)->value = value;
return 0;
}
| DoS | 0 | int json_integer_set(json_t *json, json_int_t value)
{
if(!json_is_integer(json))
return -1;
json_to_integer(json)->value = value;
return 0;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,772 | json_int_t json_integer_value(const json_t *json)
{
if(!json_is_integer(json))
return 0;
return json_to_integer(json)->value;
}
| DoS | 0 | json_int_t json_integer_value(const json_t *json)
{
if(!json_is_integer(json))
return 0;
return json_to_integer(json)->value;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,773 | json_t *json_null(void)
{
static json_t the_null = {JSON_NULL, (size_t)-1};
return &the_null;
}
| DoS | 0 | json_t *json_null(void)
{
static json_t the_null = {JSON_NULL, (size_t)-1};
return &the_null;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,774 | int json_object_clear(json_t *json)
{
json_object_t *object;
if(!json_is_object(json))
return -1;
object = json_to_object(json);
hashtable_clear(&object->hashtable);
object->serial = 0;
return 0;
}
| DoS | 0 | int json_object_clear(json_t *json)
{
json_object_t *object;
if(!json_is_object(json))
return -1;
object = json_to_object(json);
hashtable_clear(&object->hashtable);
object->serial = 0;
return 0;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,775 | static json_t *json_object_deep_copy(const json_t *object)
{
json_t *result;
void *iter;
result = json_object();
if(!result)
return NULL;
/* Cannot use json_object_foreach because object has to be cast
non-const */
iter = json_object_iter((json_t *)object);
while(iter) {
... | DoS | 0 | static json_t *json_object_deep_copy(const json_t *object)
{
json_t *result;
void *iter;
result = json_object();
if(!result)
return NULL;
/* Cannot use json_object_foreach because object has to be cast
non-const */
iter = json_object_iter((json_t *)object);
while(iter) {
... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,776 | int json_object_del(json_t *json, const char *key)
{
json_object_t *object;
if(!json_is_object(json))
return -1;
object = json_to_object(json);
return hashtable_del(&object->hashtable, key);
}
| DoS | 0 | int json_object_del(json_t *json, const char *key)
{
json_object_t *object;
if(!json_is_object(json))
return -1;
object = json_to_object(json);
return hashtable_del(&object->hashtable, key);
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,777 | static int json_object_equal(json_t *object1, json_t *object2)
{
const char *key;
json_t *value1, *value2;
if(json_object_size(object1) != json_object_size(object2))
return 0;
json_object_foreach(object1, key, value1) {
value2 = json_object_get(object2, key);
if(!json_equal(va... | DoS | 0 | static int json_object_equal(json_t *object1, json_t *object2)
{
const char *key;
json_t *value1, *value2;
if(json_object_size(object1) != json_object_size(object2))
return 0;
json_object_foreach(object1, key, value1) {
value2 = json_object_get(object2, key);
if(!json_equal(va... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,778 | json_t *json_object_get(const json_t *json, const char *key)
{
json_object_t *object;
if(!json_is_object(json))
return NULL;
object = json_to_object(json);
return hashtable_get(&object->hashtable, key);
}
| DoS | 0 | json_t *json_object_get(const json_t *json, const char *key)
{
json_object_t *object;
if(!json_is_object(json))
return NULL;
object = json_to_object(json);
return hashtable_get(&object->hashtable, key);
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,779 | void *json_object_iter(json_t *json)
{
json_object_t *object;
if(!json_is_object(json))
return NULL;
object = json_to_object(json);
return hashtable_iter(&object->hashtable);
}
| DoS | 0 | void *json_object_iter(json_t *json)
{
json_object_t *object;
if(!json_is_object(json))
return NULL;
object = json_to_object(json);
return hashtable_iter(&object->hashtable);
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,780 | void *json_object_iter_at(json_t *json, const char *key)
{
json_object_t *object;
if(!key || !json_is_object(json))
return NULL;
object = json_to_object(json);
return hashtable_iter_at(&object->hashtable, key);
}
| DoS | 0 | void *json_object_iter_at(json_t *json, const char *key)
{
json_object_t *object;
if(!key || !json_is_object(json))
return NULL;
object = json_to_object(json);
return hashtable_iter_at(&object->hashtable, key);
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,781 | const char *json_object_iter_key(void *iter)
{
if(!iter)
return NULL;
return hashtable_iter_key(iter);
}
| DoS | 0 | const char *json_object_iter_key(void *iter)
{
if(!iter)
return NULL;
return hashtable_iter_key(iter);
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,782 | void *json_object_iter_next(json_t *json, void *iter)
{
json_object_t *object;
if(!json_is_object(json) || iter == NULL)
return NULL;
object = json_to_object(json);
return hashtable_iter_next(&object->hashtable, iter);
}
| DoS | 0 | void *json_object_iter_next(json_t *json, void *iter)
{
json_object_t *object;
if(!json_is_object(json) || iter == NULL)
return NULL;
object = json_to_object(json);
return hashtable_iter_next(&object->hashtable, iter);
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,783 | int json_object_iter_set_new(json_t *json, void *iter, json_t *value)
{
if(!json_is_object(json) || !iter || !value)
return -1;
hashtable_iter_set(iter, value);
return 0;
}
| DoS | 0 | int json_object_iter_set_new(json_t *json, void *iter, json_t *value)
{
if(!json_is_object(json) || !iter || !value)
return -1;
hashtable_iter_set(iter, value);
return 0;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,784 | json_t *json_object_iter_value(void *iter)
{
if(!iter)
return NULL;
return (json_t *)hashtable_iter_value(iter);
}
| DoS | 0 | json_t *json_object_iter_value(void *iter)
{
if(!iter)
return NULL;
return (json_t *)hashtable_iter_value(iter);
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,785 | void *json_object_key_to_iter(const char *key)
{
if(!key)
return NULL;
return hashtable_key_to_iter(key);
}
| DoS | 0 | void *json_object_key_to_iter(const char *key)
{
if(!key)
return NULL;
return hashtable_key_to_iter(key);
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,786 | int json_object_set_new(json_t *json, const char *key, json_t *value)
{
if(!key || !utf8_check_string(key, -1))
{
json_decref(value);
return -1;
}
return json_object_set_new_nocheck(json, key, value);
}
| DoS | 0 | int json_object_set_new(json_t *json, const char *key, json_t *value)
{
if(!key || !utf8_check_string(key, -1))
{
json_decref(value);
return -1;
}
return json_object_set_new_nocheck(json, key, value);
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,787 | int json_object_set_new_nocheck(json_t *json, const char *key, json_t *value)
{
json_object_t *object;
if(!value)
return -1;
if(!key || !json_is_object(json) || json == value)
{
json_decref(value);
return -1;
}
object = json_to_object(json);
if(hashtable_set(&objec... | DoS | 0 | int json_object_set_new_nocheck(json_t *json, const char *key, json_t *value)
{
json_object_t *object;
if(!value)
return -1;
if(!key || !json_is_object(json) || json == value)
{
json_decref(value);
return -1;
}
object = json_to_object(json);
if(hashtable_set(&objec... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,788 | int json_object_update(json_t *object, json_t *other)
{
const char *key;
json_t *value;
if(!json_is_object(object) || !json_is_object(other))
return -1;
json_object_foreach(other, key, value) {
if(json_object_set_nocheck(object, key, value))
return -1;
}
return 0;
... | DoS | 0 | int json_object_update(json_t *object, json_t *other)
{
const char *key;
json_t *value;
if(!json_is_object(object) || !json_is_object(other))
return -1;
json_object_foreach(other, key, value) {
if(json_object_set_nocheck(object, key, value))
return -1;
}
return 0;
... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,789 | int json_object_update_existing(json_t *object, json_t *other)
{
const char *key;
json_t *value;
if(!json_is_object(object) || !json_is_object(other))
return -1;
json_object_foreach(other, key, value) {
if(json_object_get(object, key))
json_object_set_nocheck(object, key, v... | DoS | 0 | int json_object_update_existing(json_t *object, json_t *other)
{
const char *key;
json_t *value;
if(!json_is_object(object) || !json_is_object(other))
return -1;
json_object_foreach(other, key, value) {
if(json_object_get(object, key))
json_object_set_nocheck(object, key, v... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,790 | int json_object_update_missing(json_t *object, json_t *other)
{
const char *key;
json_t *value;
if(!json_is_object(object) || !json_is_object(other))
return -1;
json_object_foreach(other, key, value) {
if(!json_object_get(object, key))
json_object_set_nocheck(object, key, v... | DoS | 0 | int json_object_update_missing(json_t *object, json_t *other)
{
const char *key;
json_t *value;
if(!json_is_object(object) || !json_is_object(other))
return -1;
json_object_foreach(other, key, value) {
if(!json_object_get(object, key))
json_object_set_nocheck(object, key, v... | @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,791 | json_t *json_real(double value)
{
json_real_t *real;
if(isnan(value) || isinf(value))
return NULL;
real = jsonp_malloc(sizeof(json_real_t));
if(!real)
return NULL;
json_init(&real->json, JSON_REAL);
real->value = value;
return &real->json;
}
| DoS | 0 | json_t *json_real(double value)
{
json_real_t *real;
if(isnan(value) || isinf(value))
return NULL;
real = jsonp_malloc(sizeof(json_real_t));
if(!real)
return NULL;
json_init(&real->json, JSON_REAL);
real->value = value;
return &real->json;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,792 | static json_t *json_real_copy(const json_t *real)
{
return json_real(json_real_value(real));
}
| DoS | 0 | static json_t *json_real_copy(const json_t *real)
{
return json_real(json_real_value(real));
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,793 | int json_real_set(json_t *json, double value)
{
if(!json_is_real(json) || isnan(value) || isinf(value))
return -1;
json_to_real(json)->value = value;
return 0;
}
| DoS | 0 | int json_real_set(json_t *json, double value)
{
if(!json_is_real(json) || isnan(value) || isinf(value))
return -1;
json_to_real(json)->value = value;
return 0;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,794 | double json_real_value(const json_t *json)
{
if(!json_is_real(json))
return 0;
return json_to_real(json)->value;
}
| DoS | 0 | double json_real_value(const json_t *json)
{
if(!json_is_real(json))
return 0;
return json_to_real(json)->value;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,795 | static json_t *json_string_copy(const json_t *string)
{
return json_string_nocheck(json_string_value(string));
}
| DoS | 0 | static json_t *json_string_copy(const json_t *string)
{
return json_string_nocheck(json_string_value(string));
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,796 | static int json_string_equal(json_t *string1, json_t *string2)
{
return strcmp(json_string_value(string1), json_string_value(string2)) == 0;
}
| DoS | 0 | static int json_string_equal(json_t *string1, json_t *string2)
{
return strcmp(json_string_value(string1), json_string_value(string2)) == 0;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,797 | const char *json_string_value(const json_t *json)
{
if(!json_is_string(json))
return NULL;
return json_to_string(json)->value;
}
| DoS | 0 | const char *json_string_value(const json_t *json)
{
if(!json_is_string(json))
return NULL;
return json_to_string(json)->value;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,798 | json_t *json_true(void)
{
static json_t the_true = {JSON_TRUE, (size_t)-1};
return &the_true;
}
| DoS | 0 | json_t *json_true(void)
{
static json_t the_true = {JSON_TRUE, (size_t)-1};
return &the_true;
}
| @@ -9,11 +9,19 @@
#define _GNU_SOURCE
#endif
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#include "jansson.h"
#include "hashtable.h"
#include "jansson_private.h"
@@ -3... | CWE-310 | null | null |
32,799 | static int cmpfile(const char *str, const char *path, const char *fname)
{
char filename[1024], *buffer;
int ret;
FILE *file;
sprintf(filename, "%s%c%s", path, dir_sep, fname);
file = fopen(filename, "rb");
if (!file) {
if (conf.strip)
strcat(filename, ".strip");
els... | DoS | 0 | static int cmpfile(const char *str, const char *path, const char *fname)
{
char filename[1024], *buffer;
int ret;
FILE *file;
sprintf(filename, "%s%c%s", path, dir_sep, fname);
file = fopen(filename, "rb");
if (!file) {
if (conf.strip)
strcat(filename, ".strip");
els... | @@ -37,6 +37,8 @@ struct config {
int sort_keys;
int strip;
int use_env;
+ int have_hashseed;
+ int hashseed;
} conf;
#define l_isspace(c) ((c) == ' ' || (c) == '\n' || (c) == '\r' || (c) == '\t')
@@ -108,6 +110,12 @@ static void read_conf(FILE *conffile)
conf.sort_keys = atoi(val)... | CWE-310 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.