CVE-2019-3824 ldb: Improve code style and layout in wildcard processing
authorAndrew Bartlett <abartlet@samba.org>
Sun, 3 Feb 2019 22:22:50 +0000 (11:22 +1300)
committerStefan Metzmacher <metze@samba.org>
Tue, 26 Feb 2019 06:50:15 +0000 (07:50 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13773

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/common/ldb_match.c

index 1920b661f751a6239ac4c8feb8ede1e1db6daec9..ab0a89888f0dccccd5d3f14564c2df5987a42032 100644 (file)
@@ -333,9 +333,11 @@ static int ldb_wildcard_compare(struct ldb_context *ldb,
 
                                g = memmem(haystack,
                                           haystacklen,
-                                       (const uint8_t *)cnk.data,
-                                       cnk.length);
-                               if (g) p = g;
+                                          (const uint8_t *)cnk.data,
+                                          cnk.length);
+                               if (g) {
+                                       p = g;
+                               }
                        } while(g);
                }
                val.length = val.length - (p - (uint8_t *)(val.data)) - cnk.length;