Explorar el Código

run_command: strlen() will not function if string is not null terminated

master
Aaron Marcher hace 7 años
padre
commit
8a29374783
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: 74B048E5C2474F9A
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. +1
    -1
      slstatus.c

+ 1
- 1
slstatus.c Ver fichero

@@ -426,7 +426,7 @@ run_command(const char *cmd)
}
fgets(buf, sizeof(buf), fp);
pclose(fp);
buf[strlen(buf)] = '\0';
buf[sizeof(buf)] = '\0';

if ((nlptr = strstr(buf, "\n")) != NULL) {
nlptr[0] = '\0';


Cargando…
Cancelar
Guardar