mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-27 04:20:13 +08:00
修复可能内存越界的bug
This commit is contained in:
parent
71c9b11eca
commit
44ef632c76
@ -260,7 +260,7 @@ string System::execute(const string &cmd) {
|
||||
}
|
||||
string ret;
|
||||
char buff[1024] = {0};
|
||||
while(fgets(buff, sizeof(buff), fPipe)){
|
||||
while(fgets(buff, sizeof(buff) - 1, fPipe)){
|
||||
ret.append(buff);
|
||||
}
|
||||
pclose(fPipe);
|
||||
|
Loading…
Reference in New Issue
Block a user