| 1 | From 028f59bef0ea9435fb8fbe095b2939652ce63479 Mon Sep 17 00:00:00 2001
|
| 2 | From: Nicholas Marriott <[email protected]>
|
| 3 | Date: Mon, 3 Apr 2023 08:54:28 +0100
|
| 4 | Subject: [PATCH] Fix use-after-free, GitHub issue 126.
|
| 5 |
|
| 6 | ---
|
| 7 | connect.c | 2 +-
|
| 8 | 1 file changed, 1 insertion(+), 1 deletion(-)
|
| 9 |
|
| 10 | diff --git a/connect.c b/connect.c
|
| 11 | index 1dc5db9..da8013e 100644
|
| 12 | |
| 13 | |
| 14 | @@ -550,8 +550,8 @@ httpproxy(struct server *srv,
|
| 15 | if (strlen(line) < 12 ||
|
| 16 | strncmp(line, "HTTP/", 5) != 0 ||
|
| 17 | strncmp(line + 8, " 200", 4) != 0) {
|
| 18 | - xfree(line);
|
| 19 | xasprintf(cause, "unexpected data: %s", line);
|
| 20 | + xfree(line);
|
| 21 | return (-1);
|
| 22 | }
|
| 23 | header = 1;
|