Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

PVS-Studio warnings

Abierto
#140 4 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
c
Área
backend

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de openstreetmap/mod_tile

Todos los issues de openstreetmap/mod_tile

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.