[libsoup/nacho/invalid-percent-encoding-path: 2/2] server: fix crash when sending an invalid percent encoding path
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/nacho/invalid-percent-encoding-path: 2/2] server: fix crash when sending an invalid percent encoding path
- Date: Mon, 31 Jan 2022 11:47:48 +0000 (UTC)
commit bdc21b67be62b8c7cd4a82c621974816966cc804
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date: Mon Jan 31 12:44:37 2022 +0100
server: fix crash when sending an invalid percent encoding path
Fixes #262
libsoup/server/soup-server.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/libsoup/server/soup-server.c b/libsoup/server/soup-server.c
index 80e67129..14b2f2f7 100644
--- a/libsoup/server/soup-server.c
+++ b/libsoup/server/soup-server.c
@@ -858,7 +858,8 @@ got_headers (SoupServer *server,
decoded_path = g_uri_unescape_string (g_uri_get_path (uri), NULL);
- if (strstr (decoded_path, "/../") ||
+ if (decoded_path == NULL ||
+ strstr (decoded_path, "/../") ||
g_str_has_suffix (decoded_path, "/..")
#ifdef G_OS_WIN32
||
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]