Module Name:    src
Committed By:   sevan
Date:           Fri May  4 19:45:27 UTC 2018

Modified Files:
        src/libexec/httpd/lua: glue.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/libexec/httpd/lua/glue.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/httpd/lua/glue.c
diff -u src/libexec/httpd/lua/glue.c:1.3 src/libexec/httpd/lua/glue.c:1.4
--- src/libexec/httpd/lua/glue.c:1.3	Tue May  1 23:51:53 2018
+++ src/libexec/httpd/lua/glue.c	Fri May  4 19:45:27 2018
@@ -155,6 +155,9 @@ l_bozo_process_request(lua_State *L)
 	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 @@ l_bozo_clean_request(lua_State *L)
 	bozo_httpreq_t	*req;
 
 	req = lua_touserdata(L, 1);
+	if (req == NULL) {
+		return 0;
+	}
 	bozo_clean_request(req);
 	lua_pushnumber(L, 1);
 	return 1;

Reply via email to