mirror of https://github.com/BOINC/boinc.git
Merge pull request #5795 from BOINC/dpa_coverity_27814
fix possible buffer overflow
This commit is contained in:
commit
53d8fb49c9
|
@ -107,7 +107,7 @@ int switcher_exec(const char *util_filename, const char* cmdline) {
|
|||
|
||||
// Capture stdout output
|
||||
while (1) {
|
||||
ssize_t count = read(fds_out[0], buffer, sizeof(buffer));
|
||||
ssize_t count = read(fds_out[0], buffer, sizeof(buffer)-1);
|
||||
if (count == -1) {
|
||||
if (errno == EINTR) {
|
||||
continue;
|
||||
|
@ -124,7 +124,7 @@ int switcher_exec(const char *util_filename, const char* cmdline) {
|
|||
|
||||
// Capture stderr output
|
||||
while (1) {
|
||||
ssize_t count = read(fds_err[0], buffer, sizeof(buffer));
|
||||
ssize_t count = read(fds_err[0], buffer, sizeof(buffer)-1);
|
||||
if (count == -1) {
|
||||
if (errno == EINTR) {
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue