mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-03-06 06:00:54 +08:00
修复可能内存越界的bug
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user