[OpenBIOS] r526 - in ofw: inet inetv6

svn at openbios.org svn at openbios.org
Mon Aug 6 03:02:44 CEST 2007


Author: wmb
Date: 2007-08-06 03:02:44 +0200 (Mon, 06 Aug 2007)
New Revision: 526

Modified:
   ofw/inet/dns.fth
   ofw/inetv6/dns.fth
Log:
Use of malformed dotted IP addresses could leave base set to decimal.


Modified: ofw/inet/dns.fth
===================================================================
--- ofw/inet/dns.fth	2007-08-06 00:29:32 UTC (rev 525)
+++ ofw/inet/dns.fth	2007-08-06 01:02:44 UTC (rev 526)
@@ -233,13 +233,11 @@
 : ?bad-ip  ( flag -- )  abort" Bad host name or address"  ;
 4 buffer: ip-buf
 : $>ip  ( adr len -- 'ip )
-   push-decimal
    ip-buf 4  bounds  do
-      [char] . left-parse-string  $number ?bad-ip
+      [char] . left-parse-string  push-decimal $number pop-base  ?bad-ip
       dup  d# 256 >=  ?bad-ip
       i c!
    loop
-   pop-base
    2drop
    ip-buf
 ;

Modified: ofw/inetv6/dns.fth
===================================================================
--- ofw/inetv6/dns.fth	2007-08-06 00:29:32 UTC (rev 525)
+++ ofw/inetv6/dns.fth	2007-08-06 01:02:44 UTC (rev 526)
@@ -233,13 +233,11 @@
 : ?bad-ip  ( flag -- )  abort" Bad host name or address"  ;
 4 buffer: ip-buf
 : $>ip  ( adr len -- 'ip )
-   push-decimal
    ip-buf 4  bounds  do
-      [char] . left-parse-string  $number ?bad-ip
+      [char] . left-parse-string  push-decimal $number pop-base  ?bad-ip
       dup  d# 256 >=  ?bad-ip
       i c!
    loop
-   pop-base
    2drop
    ip-buf
 ;




More information about the OpenBIOS mailing list