]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: config: Don't dump keywords if argument is NULL
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 18 May 2020 10:14:18 +0000 (12:14 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 18 May 2020 16:30:06 +0000 (18:30 +0200)
Helper functions are used to dump bind, server or filter keywords. These
functions are used to report errors during the configuration parsing. To have a
coherent API, these functions are now prepared to handle a null pointer as
argument. If so, no action is performed and functions immediately return.

This patch should fix the issue #631. It is not a bug. There is no reason to
backport it.

src/filters.c
src/listener.c
src/server.c

index e2750504080e1ab3b7e688bee1fb6437298dad93..07b90431653f5eabbc530ab54ccf46a2cb9696af 100644 (file)
@@ -142,6 +142,9 @@ flt_dump_kws(char **out)
        struct flt_kw_list *kwl;
        int index;
 
+       if (!out)
+               return;
+
        *out = NULL;
        list_for_each_entry(kwl, &flt_keywords.list, list) {
                for (index = 0; kwl->kw[index].kw != NULL; index++) {
index 829dc99b74efe6dfb29d0405e31f3fe154597731..01feee58f2544893a6e7ff8a29dd892ed4cd311e 100644 (file)
@@ -1255,6 +1255,9 @@ void bind_dump_kws(char **out)
        struct bind_kw_list *kwl;
        int index;
 
+       if (!out)
+               return;
+
        *out = NULL;
        list_for_each_entry(kwl, &bind_keywords.list, list) {
                for (index = 0; kwl->kw[index].kw != NULL; index++) {
index 265106eb8715f5c8ff4f5861847342626abe7ec5..e4044cd7a685c9b8ee91d34be8704a0ae7ff03da 100644 (file)
@@ -247,6 +247,9 @@ void srv_dump_kws(char **out)
        struct srv_kw_list *kwl;
        int index;
 
+       if (!out)
+               return;
+
        *out = NULL;
        list_for_each_entry(kwl, &srv_keywords.list, list) {
                for (index = 0; kwl->kw[index].kw != NULL; index++) {