Same infinite loop bug as I fixed in SAMBA_2_0, but I just spent half
authorMatthew Chapman <matty@samba.org>
Tue, 23 Mar 1999 14:56:25 +0000 (14:56 +0000)
committerMatthew Chapman <matty@samba.org>
Tue, 23 Mar 1999 14:56:25 +0000 (14:56 +0000)
an hour tracking it down in HEAD so I'm going to commit it here as well.
(This used to be commit 9a482aedb2c4eb7439e2edc092642d315d2a595b)

source3/lib/util_str.c

index 31dc9bfd62c3150fc80f94797116a825a98a1897..142f0af4c8717b4bfa87ebf8773f0e6f73e6762a 100644 (file)
@@ -882,16 +882,16 @@ size_t strhex_to_str(char *p, size_t len, const char *strhex)
                        continue;
                }
 
-               while (!(p1 = strchr(hexchars, toupper(strhex[i]))))
+               if (!(p1 = strchr(hexchars, toupper(strhex[i]))))
                {
-                       continue;
+                       break;
                }
 
                i++; /* next hex digit */
 
-               while (!(p2 = strchr(hexchars, toupper(strhex[i]))))
+               if (!(p2 = strchr(hexchars, toupper(strhex[i]))))
                {
-                       continue;
+                       break;
                }
 
                /* get the two nybbles */