[Slirp] [Git][slirp/libslirp][master] Reject domain-search when any entry ends with ".."

Samuel Thibault (@sthibaul) gitlab at gitlab.freedesktop.org
Sun Aug 28 22:56:08 UTC 2022



Samuel Thibault pushed to branch master at slirp / libslirp


Commits:
0f080379 by Samuel Thibault at 2022-08-29T00:55:50+02:00
Reject domain-search when any entry ends with ".."

rather than rejecting only when all of them are bogus.

Reported-by: Michael T <michael.gr220 at gmail.com>
Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>

- - - - -


1 changed file:

- src/dnssearch.c


Changes:

=====================================
src/dnssearch.c
=====================================
@@ -263,15 +263,15 @@ int translate_dnssearch(Slirp *s, const char **names)
     for (i = 0; i < num_domains; i++) {
         domains[i].labels = outptr;
         domain_mklabels(domains + i, names[i]);
+        if (domains[i].len == 0) {
+            /* Bogus entry, reject it all */
+            g_free(domains);
+            g_free(result);
+            return -1;
+        }
         outptr += domains[i].len;
     }
 
-    if (outptr == result) {
-        g_free(domains);
-        g_free(result);
-        return -1;
-    }
-
     qsort(domains, num_domains, sizeof(*domains), domain_suffix_ord);
     domain_fixup_order(domains, num_domains);
 



View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/commit/0f08037929376160d1aa43456791d12dcc5b3003

-- 
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/commit/0f08037929376160d1aa43456791d12dcc5b3003
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/slirp/attachments/20220828/fe3b49a2/attachment-0001.htm>


More information about the Slirp mailing list