# HG changeset patch # User Matti Hamalainen # Date 1607860386 -7200 # Node ID c834e1393eb0a0482d79db2352f5459e6b1da6b9 # Parent ff724f45162ad75ca2c8b470f17497c1e0fc2904 Initialize regex parsing context before checking pointers. diff -r ff724f45162a -r c834e1393eb0 th_regex.c --- a/th_regex.c Wed Nov 11 15:08:03 2020 +0200 +++ b/th_regex.c Sun Dec 13 13:53:06 2020 +0200 @@ -457,6 +457,8 @@ th_char_t *tmp = NULL; size_t start; + memset(&ctx, 0, sizeof(ctx)); + // Check pointers if (pexpr == NULL || pattern == NULL) { @@ -465,7 +467,6 @@ } // Initialize parsing context - memset(&ctx, 0, sizeof(ctx)); ctx.pattern = pattern; ctx.bufSize = 256;