Fix buffer overrun
This commit is contained in:
parent
13cd7f67e6
commit
0385b58b3d
1 changed files with 1 additions and 1 deletions
|
@ -640,7 +640,7 @@ readlinefromfile(const char *path, char *buf, size_t buflen)
|
|||
if(r < 0)
|
||||
return -1;
|
||||
|
||||
buf[buflen] = 0;
|
||||
buf[buflen - 1] = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue