diff --git a/daemon/unbound.c b/daemon/unbound.c index 0efa353da..bc6d2bc9e 100644 --- a/daemon/unbound.c +++ b/daemon/unbound.c @@ -365,6 +365,11 @@ writepid (const char* pidfile, pid_t pid) pidfile, strerror(errno)); close(fd); return 0; + } else if(r == 0) { + log_err("cannot write any bytes to pidfile %s: " + "write returns 0 bytes written", pidfile); + close(fd); + return 0; } count += r; } diff --git a/doc/Changelog b/doc/Changelog index 5bb0f05f3..5d158ef5d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -8,6 +8,7 @@ - Option to toggle udp-connect, default is enabled. - Fix for #303 CVE-2020-28935 : Fix that symlink does not interfere with chown of pidfile. + - Further fix for it and retvalue 0 fix for it. 12 November 2020: Wouter - Fix to connect() to UDP destinations, default turned on,