diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2017-08-04 00:10:15 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2017-08-04 00:10:15 +0000 |
commit | a2701609fdc39ac54285ea4c6ee8341cf8e7dc9c (patch) | |
tree | 43c0a9015bcd352e56f137fd25cc5f61de36d1dd /sbin/dhclient/kroute.c | |
parent | 3aaef91e48cf29724207ecd9085e31c1a1bd8b9c (diff) |
Do not attempt to parse zero'd input buffer after
read() on routing socket fails. Just bail.
Diffstat (limited to 'sbin/dhclient/kroute.c')
-rw-r--r-- | sbin/dhclient/kroute.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/dhclient/kroute.c b/sbin/dhclient/kroute.c index 9d6ec390ac2..ea1cee53d04 100644 --- a/sbin/dhclient/kroute.c +++ b/sbin/dhclient/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.127 2017/08/03 14:53:22 krw Exp $ */ +/* $OpenBSD: kroute.c,v 1.128 2017/08/04 00:10:14 krw Exp $ */ /* * Copyright 2012 Kenneth R Westerback <krw@openbsd.org> @@ -781,10 +781,10 @@ resolv_conf_priority(int rdomain, int routefd) len = read(routefd, &m_rtmsg, sizeof(m_rtmsg)); if (len == -1) { log_warn("get default route read"); - break; + goto done; } else if (len == 0) { log_warnx("no data from default route read"); - break; + goto done; } if (m_rtmsg.m_rtm.rtm_version != RTM_VERSION) continue; |