]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Validate HTTP path passed to dig
authorArtem Boldariev <artem@boldariev.com>
Wed, 29 Sep 2021 16:37:15 +0000 (19:37 +0300)
committerArtem Boldariev <artem@boldariev.com>
Wed, 29 Sep 2021 16:42:03 +0000 (19:42 +0300)
The commit makes sure that the HTTP path passed to dig is a valid one.

bin/dig/dig.c

index 7b1e649d1c805d86fd5a78a90731c28960bd0263..0b1a0bfcb97690ad177a4acb0285b6ac77834afa 100644 (file)
@@ -1482,6 +1482,14 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
                                lookup->https_path = isc_mem_strdup(
                                        mctx, ISC_NM_HTTP_DEFAULT_PATH);
                        } else {
+                               if (!isc_nm_http_path_isvalid(value)) {
+                                       fprintf(stderr,
+                                               ";; The given HTTP path \"%s\" "
+                                               "is not "
+                                               "a valid absolute path\n",
+                                               value);
+                                       goto invalid_option;
+                               }
                                lookup->https_path = isc_mem_strdup(mctx,
                                                                    value);
                        }