Merge remote-tracking branch 'qubesos/pr/102'

* qubesos/pr/102:
  qrexec-fork-server: Always initialize addrlen argument of accept()
This commit is contained in:
Marek Marczykowski-Górecki 2018-03-20 01:17:08 +01:00
commit 2301da6e6f
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -112,12 +112,15 @@ int main(int argc, char **argv) {
signal(SIGCHLD, SIG_IGN);
register_exec_func(do_exec);
while ((fd = accept(s, (struct sockaddr *) &peer, &addrlen)) >= 0) {
while (1) {
addrlen = sizeof(peer);
fd = accept(s, (struct sockaddr *) &peer, &addrlen);
if (fd < 0)
break;
if (read_all(fd, &info, sizeof(info))) {
handle_single_command(fd, &info);
}
close(fd);
addrlen = sizeof(peer);
}
close(s);
unlink(socket_path);