Fix previous commit. The standards specifically say: "The structure
sigaction, used to describe an action to be taken, is defined in the header <signal.h> to include at least the following members:" ^^^^^^^^ A sigaction defined on stack with essentially random contents may have just about anything underneath fields that the program doesn't know about. It is not safe to delete the bzero.
This commit is contained in:
parent
2e24786038
commit
891ba08303
@ -665,6 +665,7 @@ res_send(buf, buflen, ans, anssiz)
|
|||||||
pfd.fd = s;
|
pfd.fd = s;
|
||||||
pfd.events = POLLIN;
|
pfd.events = POLLIN;
|
||||||
if (use_poll == 1) {
|
if (use_poll == 1) {
|
||||||
|
bzero(&sa, sizeof(sa));
|
||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
sa.sa_flags = 0;
|
sa.sa_flags = 0;
|
||||||
sa.sa_handler = SIG_IGN;
|
sa.sa_handler = SIG_IGN;
|
||||||
|
Loading…
Reference in New Issue
Block a user