Merge pull request #5795 from BOINC/dpa_coverity_27814

fix possible buffer overflow
This commit is contained in:
Vitalii Koshura 2024-09-06 01:24:15 +02:00 committed by GitHub
commit 53d8fb49c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

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