diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-02-24 14:18:49 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-02-24 14:18:49 -0800 |
commit | 8a4b35805fdc6651d288a3e1c2d98aa504cb9c05 (patch) | |
tree | 37c4bdef99996ab681e03c7a3f407563a9ff35d7 /com32/lib/syslinux/pxe_dns.c | |
parent | 3ae1da98a68d2f719ce17766550f7e9682ba8ae7 (diff) | |
download | syslinux-8a4b35805fdc6651d288a3e1c2d98aa504cb9c05.tar.gz |
com32: replace hard-coded bounce buffer use in com32/libsyslinux-4.00-pre25
Replace hard-coded bounce buffer uses in com32/lib with lmalloc/lfree.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/lib/syslinux/pxe_dns.c')
-rw-r--r-- | com32/lib/syslinux/pxe_dns.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/com32/lib/syslinux/pxe_dns.c b/com32/lib/syslinux/pxe_dns.c index 9ab95137..6620396f 100644 --- a/com32/lib/syslinux/pxe_dns.c +++ b/com32/lib/syslinux/pxe_dns.c @@ -48,21 +48,26 @@ uint32_t pxe_dns(const char *hostname) unsigned char b[4]; uint32_t ip; } q; + char *lm_hostname; /* Is this a dot-quad? */ if (sscanf(hostname, "%hhu.%hhu.%hhu.%hhu", &q.b[0], &q.b[1], &q.b[2], &q.b[3]) == 4) return q.ip; + lm_hostname = lstrdup(hostname); + if (!lm_hostname) + return 0; + memset(®s, 0, sizeof regs); regs.eax.w[0] = 0x0010; - regs.es = SEG(__com32.cs_bounce); - regs.ebx.w[0] = OFFS(__com32.cs_bounce); - - strcpy((char *)__com32.cs_bounce, hostname); + regs.es = SEG(lm_hostname); + /* regs.ebx.w[0] = OFFS(lm_hostname); */ __intcall(0x22, ®s, ®s); + lfree(lm_hostname); + if (regs.eflags.l & EFLAGS_CF) return 0; |