Same infinite loop bug as I fixed in SAMBA_2_0, but I just spent half
[samba.git] / 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 */