]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: ssl/ckch: potential null pointer dereference
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 2 Apr 2025 08:02:07 +0000 (10:02 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Wed, 2 Apr 2025 08:02:07 +0000 (10:02 +0200)
src/ssl_ckch.c: In function ‘ckch_conf_parse’:
src/ssl_ckch.c:4852:40: error: potential null pointer dereference [-Werror=null-dereference]
 4852 |                                 while (*r) {
      |                                        ^~

Add a test on r before using *r.

No backport needed

src/ssl_ckch.c

index 4352bfc26579bb55393dfc872d0f3881df34c56e..203d25270b29fcbadc7f5160ebbff9d727e7f92c 100644 (file)
@@ -4849,7 +4849,7 @@ int ckch_conf_parse(char **args, int cur_arg, struct ckch_conf *f, int *found, c
 
                                goto out;
 array_err:
-                               while (*r) {
+                               while (r && *r) {
                                        char *prev = *r;
                                        r++;
                                        free(prev);