projects
/
platform
/
upstream
/
syslinux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c136a3
)
pxe: allow an empty input to dns_resolv()
author
H. Peter Anvin
<hpa@zytor.com>
Sun, 24 Apr 2011 21:51:31 +0000
(14:51 -0700)
committer
H. Peter Anvin
<hpa@zytor.com>
Sun, 24 Apr 2011 21:51:31 +0000
(14:51 -0700)
If dns_resolv() gets an empty input, just return failure.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/fs/pxe/dnsresolv.c
patch
|
blob
|
history
diff --git
a/core/fs/pxe/dnsresolv.c
b/core/fs/pxe/dnsresolv.c
index
a4bbf1f
..
350dfe3
100644
(file)
--- a/
core/fs/pxe/dnsresolv.c
+++ b/
core/fs/pxe/dnsresolv.c
@@
-92,6
+92,14
@@
uint32_t dns_resolv(const char *name)
err_t err;
struct ip_addr ip;
+ /*
+ * Return failure on an empty input... this can happen during
+ * some types of URL parsing, and this is the easiest place to
+ * check for it.
+ */
+ if (!name || !*name)
+ return 0;
+
/* If it is a valid dot quad, just return that value */
if (parse_dotquad(name, &ip.addr))
return ip.addr;