@@ -1544,7 +1544,7 @@ struct in6_addr str_to_in6_addr(char *nptr, char **endptr)
1544
1544
1545
1545
for (int i = 0 ; i < sizeof (ret ); i ++ )
1546
1546
{
1547
- if (!isxdigit ( * nptr ) || !isxdigit ( * nptr + 1 ))
1547
+ if (!isxdigit ( * nptr ) || !isxdigit ( * ( nptr + 1 ) ))
1548
1548
{
1549
1549
/* invalid hex string */
1550
1550
if (endptr ) * endptr = nptr ;
@@ -1574,17 +1574,14 @@ static NTSTATUS ipv6_forward_enumerate_all( void *key_data, UINT key_size, void
1574
1574
1575
1575
#ifdef __linux__
1576
1576
{
1577
- char buf [512 ], * ptr ;
1577
+ char buf [512 ], * ptr , * end ;
1578
1578
UINT rtf_flags ;
1579
1579
FILE * fp ;
1580
1580
1581
1581
if (!(fp = fopen ( "/proc/net/ipv6_route" , "r" ))) return STATUS_NOT_SUPPORTED ;
1582
1582
1583
1583
while ((ptr = fgets ( buf , sizeof (buf ), fp )))
1584
1584
{
1585
- while (!isspace ( * ptr )) ptr ++ ;
1586
- * ptr ++ = '\0' ;
1587
-
1588
1585
entry .prefix = str_to_in6_addr ( ptr , & ptr );
1589
1586
entry .prefix_len = strtoul ( ptr + 1 , & ptr , 16 );
1590
1587
str_to_in6_addr ( ptr + 1 , & ptr ); /* source network, skip */
@@ -1597,6 +1594,10 @@ static NTSTATUS ipv6_forward_enumerate_all( void *key_data, UINT key_size, void
1597
1594
entry .protocol = (rtf_flags & RTF_GATEWAY ) ? MIB_IPPROTO_NETMGMT : MIB_IPPROTO_LOCAL ;
1598
1595
entry .loopback = entry .protocol == MIB_IPPROTO_LOCAL && entry .prefix_len == 32 ;
1599
1596
1597
+ while (isspace ( * ptr )) ptr ++ ;
1598
+ end = ptr ;
1599
+ while (* end && !isspace (* end )) ++ end ;
1600
+ * end = 0 ;
1600
1601
if (!convert_unix_name_to_luid ( ptr , & entry .luid )) continue ;
1601
1602
if (!convert_luid_to_index ( & entry .luid , & entry .if_index )) continue ;
1602
1603
0 commit comments