Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/httpd/lua Do not try and process empty requests. Thi...
details: https://anonhg.NetBSD.org/src/rev/3d12fb3ea3dd
branches: trunk
changeset: 361608:3d12fb3ea3dd
user: sevan <sevan%NetBSD.org@localhost>
date: Fri May 04 19:45:27 2018 +0000
description:
Do not try and process empty requests. This resolves a crash when issuing a
carriage return to read_request() in foreground mode.
In the C daemon, a NULL check is performed on bozo_read_request in main.c
before moving on to bozo_process_request & bozo_clean_request. Here,
process_request & clean_request just return instead.
diffstat:
libexec/httpd/lua/glue.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diffs (23 lines):
diff -r aa4a6ad3f3ff -r 3d12fb3ea3dd libexec/httpd/lua/glue.c
--- a/libexec/httpd/lua/glue.c Fri May 04 19:11:59 2018 +0000
+++ b/libexec/httpd/lua/glue.c Fri May 04 19:45:27 2018 +0000
@@ -155,6 +155,9 @@
bozo_httpreq_t *req;
req = lua_touserdata(L, 1);
+ if (req == NULL) {
+ return 0;
+ }
bozo_process_request(req);
lua_pushnumber(L, 1);
return 1;
@@ -167,6 +170,9 @@
bozo_httpreq_t *req;
req = lua_touserdata(L, 1);
+ if (req == NULL) {
+ return 0;
+ }
bozo_clean_request(req);
lua_pushnumber(L, 1);
return 1;
Home |
Main Index |
Thread Index |
Old Index