Repository navigation
Open
Description
It looks like PVS-Studio found several issues in the code:
- 87 : src/store_file.c V526 : The 'memcmp' function returns 0 if corresponding buffers are equal. if (memcmp(m->magic, META_MAGIC, strlen(META_MAGIC))) { : if (memcmp(m->magic, META_MAGIC_COMPRESSED, strlen(META_MAGIC_COMPRESSED))) { : snprintf(log_msg,PATH_MAX - 1, "Meta file %s header magic mismatch\n", path); :
- 86 : src/store_file.c V526 : The 'memcmp' function returns 0 if corresponding buffers are equal. } : if (memcmp(m->magic, META_MAGIC, strlen(META_MAGIC))) { : if (memcmp(m->magic, META_MAGIC_COMPRESSED, strlen(META_MAGIC_COMPRESSED))) { :
- 87 : src/store_file.c V526 : The 'memcmp' function returns 0 if corresponding buffers are equal. if (memcmp(m->magic, META_MAGIC, strlen(META_MAGIC))) { : if (memcmp(m->magic, META_MAGIC_COMPRESSED, strlen(META_MAGIC_COMPRESSED))) { : snprintf(log_msg,PATH_MAX - 1, "Meta file %s header magic mismatch\n", path); :
- 86 : src/store_file.c V526 : The 'memcmp' function returns 0 if corresponding buffers are equal. } : if (memcmp(m->magic, META_MAGIC, strlen(META_MAGIC))) { : if (memcmp(m->magic, META_MAGIC_COMPRESSED, strlen(META_MAGIC_COMPRESSED))) { :
- 87 : src/store_file.c V526 : The 'memcmp' function returns 0 if corresponding buffers are equal. if (memcmp(m->magic, META_MAGIC, strlen(META_MAGIC))) { : if (memcmp(m->magic, META_MAGIC_COMPRESSED, strlen(META_MAGIC_COMPRESSED))) { : snprintf(log_msg,PATH_MAX - 1, "Meta file %s header magic mismatch\n", path); :
- 86 : src/store_file.c V526 : The 'memcmp' function returns 0 if corresponding buffers are equal. } : if (memcmp(m->magic, META_MAGIC, strlen(META_MAGIC))) { : if (memcmp(m->magic, META_MAGIC_COMPRESSED, strlen(META_MAGIC_COMPRESSED))) { :
- 49 : src/store_ro_http_proxy.c V701 : realloc() possible leak: when realloc() fails in allocating memory, original pointer 'chunk->memory' is lost. Consider assigning realloc() to a temporary pointer. : false : 2 : if (chunk->memory) { : chunk->memory = realloc(chunk->memory, chunk->size + realsize); : } else { :
- 182 : src/store_ro_http_proxy.c V524 : It is odd that the body of 'ro_http_proxy_metatile_expire' function is fully equivalent to the body of 'ro_http_proxy_metatile_delete' function. : false : 3 : : static int ro_http_proxy_metatile_expire(struct storage_backend * store, const char *xmlconfig, int x, int y, int z) { : : 177,182
- 849 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if(strcmp(r->handler, "tile_dirty")) : return DECLINED; :
- 887 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if (strcmp(r->handler, "tile_serve")) : return DECLINED; :
- 988 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if(strcmp(r->handler, "tile_status")) : return DECLINED; :
- 1031 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if(strcmp(r->handler, "tile_json")) : return DECLINED; :
- 1103 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if (strcmp(r->handler, "tile_mod_stats")) : return DECLINED; :
- 1179 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if(strcmp(r->handler, "tile_serve")) : return DECLINED; :
- 1424 : src/mod_tile.c V566 : The integer constant is converted to pointer. Possibly an error or a bad coding style: (const void *) 1 : false : 3 : if (!data) { : apr_pool_userdata_set((const void *) 1, userdata_key, : apr_pool_cleanup_null, s->process->pool); :
- 1499 : src/mod_tile.c V656 : Variables 'delayp->last_tile_fillup', 'delayp->last_render_fillup' are initialized through the call to the same function. It's probably an error or un-optimized code. Consider inspecting the 'apr_time_now()' expression. Check lines: 1498, 1499. : false : 3 : delayp->last_tile_fillup = apr_time_now(); : delayp->last_render_fillup = apr_time_now(); : : 1498,1499
- 849 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if(strcmp(r->handler, "tile_dirty")) : return DECLINED; :
- 887 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if (strcmp(r->handler, "tile_serve")) : return DECLINED; :
- 988 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if(strcmp(r->handler, "tile_status")) : return DECLINED; :
- 1031 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if(strcmp(r->handler, "tile_json")) : return DECLINED; :
- 1103 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if (strcmp(r->handler, "tile_mod_stats")) : return DECLINED; :
- 1179 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if(strcmp(r->handler, "tile_serve")) : return DECLINED; :
- 1424 : src/mod_tile.c V566 : The integer constant is converted to pointer. Possibly an error or a bad coding style: (const void *) 1 : false : 3 : if (!data) { : apr_pool_userdata_set((const void *) 1, userdata_key, : apr_pool_cleanup_null, s->process->pool); :
- 1499 : src/mod_tile.c V656 : Variables 'delayp->last_tile_fillup', 'delayp->last_render_fillup' are initialized through the call to the same function. It's probably an error or un-optimized code. Consider inspecting the 'apr_time_now()' expression. Check lines: 1498, 1499. : false : 3 : delayp->last_tile_fillup = apr_time_now(); : delayp->last_render_fillup = apr_time_now(); : : 1498,1499
- 49 : src/store_ro_http_proxy.c V701 : realloc() possible leak: when realloc() fails in allocating memory, original pointer 'chunk->memory' is lost. Consider assigning realloc() to a temporary pointer. : false : 2 : if (chunk->memory) { : chunk->memory = realloc(chunk->memory, chunk->size + realsize); : } else { :
- 182 : src/store_ro_http_proxy.c V524 : It is odd that the body of 'ro_http_proxy_metatile_expire' function is fully equivalent to the body of 'ro_http_proxy_metatile_delete' function. : false : 3 : : static int ro_http_proxy_metatile_expire(struct storage_backend * store, const char *xmlconfig, int x, int y, int z) { : : 177,182
- 849 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if(strcmp(r->handler, "tile_dirty")) : return DECLINED; :
- 887 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if (strcmp(r->handler, "tile_serve")) : return DECLINED; :
- 988 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if(strcmp(r->handler, "tile_status")) : return DECLINED; :
- 1031 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if(strcmp(r->handler, "tile_json")) : return DECLINED; :
- 1103 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if (strcmp(r->handler, "tile_mod_stats")) : return DECLINED; :
- 1179 : src/mod_tile.c V526 : The 'strcmp' function returns 0 if corresponding strings are equal. : if(strcmp(r->handler, "tile_serve")) : return DECLINED; :
- 1424 : src/mod_tile.c V566 : The integer constant is converted to pointer. Possibly an error or a bad coding style: (const void *) 1 : false : 3 : if (!data) { : apr_pool_userdata_set((const void *) 1, userdata_key, : apr_pool_cleanup_null, s->process->pool); :
- 1499 : src/mod_tile.c V656 : Variables 'delayp->last_tile_fillup', 'delayp->last_render_fillup' are initialized through the call to the same function. It's probably an error or un-optimized code. Consider inspecting the 'apr_time_now()' expression. Check lines: 1498, 1499. : false : 3 : delayp->last_tile_fillup = apr_time_now(); : delayp->last_render_fillup = apr_time_now(); : : 1498,1499
- 49 : src/store_ro_http_proxy.c V701 : realloc() possible leak: when realloc() fails in allocating memory, original pointer 'chunk->memory' is lost. Consider assigning realloc() to a temporary pointer. : false : 2 : if (chunk->memory) { : chunk->memory = realloc(chunk->memory, chunk->size + realsize); : } else { :
- 182 : src/store_ro_http_proxy.c V524 : It is odd that the body of 'ro_http_proxy_metatile_expire' function is fully equivalent to the body of 'ro_http_proxy_metatile_delete' function. : false : 3 : : static int ro_http_proxy_metatile_expire(struct storage_backend * store, const char *xmlconfig, int x, int y, int z) { : : 177,182
Metadata
Metadata
Assignees
Labels
No labels
Activity
pnorman commentedon Oct 6, 2016
Could you apply some formatting to make this more readable?
Komzpa commentedon Oct 6, 2016
@pnorman applied some formatting - hope it is better.
pantierra commentedon Jul 28, 2021
@Komzpa Would it be possible to get another input on the current code base? Thanks.
Komzpa commentedon Jul 29, 2021
hi @xamanu
you can do it by using the PVS-Studio yourself. they have free options:
https://pvs-studio.com/en/blog/posts/0614/
my temp key expired in 2016 :)