瀏覽代碼

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

master
Aaron Marcher 7 年之前
父節點
當前提交
8a29374783
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 74B048E5C2474F9A
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      slstatus.c

+ 1
- 1
slstatus.c 查看文件

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


Loading…
取消
儲存