Sfoglia il codice sorgente

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

master
Aaron Marcher 7 anni fa
parent
commit
8a29374783
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 74B048E5C2474F9A
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. +1
    -1
      slstatus.c

+ 1
- 1
slstatus.c Vedi File

@@ -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';


Caricamento…
Annulla
Salva