mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-12 18:23:04 +01:00
gpgscm: Fix possible segv in the process functions.
* tests/gpgscm/ffi.c (do_process_spawn_io): Fix use of FD_ISSET. -- This bug was detected on an i686 with gcc 4.1 and Linux 2.6.18 Fixes-commit: 1b0ce9918c321a5060fb7c59a234ab683187e8c1
This commit is contained in:
parent
0ec989ee3f
commit
3a523b43d4
@ -1055,7 +1055,7 @@ do_process_spawn_io (scheme *sc, pointer args)
|
||||
if (ret < 0)
|
||||
break;
|
||||
|
||||
if (FD_ISSET (out_fd, &read_fdset))
|
||||
if (out_fd >= 0 && FD_ISSET (out_fd, &read_fdset))
|
||||
{
|
||||
bytes_read = read (out_fd, out_string + out_off,
|
||||
out_len - out_off);
|
||||
@ -1079,7 +1079,7 @@ do_process_spawn_io (scheme *sc, pointer args)
|
||||
}
|
||||
}
|
||||
|
||||
if (FD_ISSET (err_fd, &read_fdset))
|
||||
if (err_fd >= 0 && FD_ISSET (err_fd, &read_fdset))
|
||||
{
|
||||
bytes_read = read (err_fd, err_string + err_off,
|
||||
err_len - err_off);
|
||||
|
Loading…
x
Reference in New Issue
Block a user