PVS-Studio warnings
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
Comienza con los hallazgos de PVS-Studio en src/store_file.c, src/store_ro_http_proxy.c y src/mod_tile.c; después, inspecciona cada función y línea referenciadas. Vuelve a ejecutar el análisis estático pertinente después de revisar las advertencias no comprobadas; se considera terminado cuando los hallazgos indicados se hayan corregido o confirmado explícitamente como intencionados, y las comprobaciones existentes del proyecto sigan pasando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- C++
- Estrellas
- 318
- Forks
- 200
- Merge medio
- 2 d 22 h
- PR fusionados (30 d)
- 22
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openstreetmap/mod_tile
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
openstreetmap/mod_tile#292 · 4 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
openstreetmap/mod_tile#477 · 7 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
openstreetmap/mod_tile#466 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
openstreetmap/mod_tile#462 · 7 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
openstreetmap/mod_tile#447 · 3 comentarios · 1 reacción ·
Los mantenedores suelen responder en 2 días
Todos los issues de openstreetmap/mod_tile
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 9 días
-
自定义颜色添加为常用颜色Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
mg-chao/snow-apps#2227 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug introduced: 5.0 cycle P3 XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
open-astro/AlpacaBridge#1722 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
returnoftheshadow/RotS_Live#521 ·
Los mantenedores suelen responder en 1 día
-
crash lld:COFF
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
llvm/llvm-project#235970 · 1 comentario ·
Los mantenedores suelen responder en 1 día