diff options
| author | ame <[email protected]> | 2025-12-01 21:12:42 -0600 |
|---|---|---|
| committer | ame <[email protected]> | 2025-12-01 21:12:42 -0600 |
| commit | 5ea12787f87f3ea60935b7a1f5b24be80cb2dec6 (patch) | |
| tree | b3083c5b7cad5fa58288c0dfd6b77d6b5677eacd /src/net.c | |
| parent | a7caf5e9f4ca1cfddafaf5880d7ee2020e3c1578 (diff) | |
minor net changes, prevent buffer indexing evil metatables
Diffstat (limited to 'src/net.c')
| -rw-r--r-- | src/net.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -843,6 +843,8 @@ void* handle_client(void *_arg){ luaI_tsetv(L, res_idx, "header", header_idx);
+ lua_pushcfunction(L, luaI_errtraceback);
+ int errtraceback_idx = lua_gettop(L);
//get all function that kinda match
parray_t* owo = (parray_t*)v;
for(int i = 0; i != owo->len; i++){
@@ -877,7 +879,7 @@ void* handle_client(void *_arg){ lua_pushvalue(L, req_idx); //push info about the request
//call the function
- if(lua_pcall(L, 2, 0, 0) != 0){
+ if(lua_pcall(L, 2, 0, errtraceback_idx) != 0){
fprintf(stderr, "(net thread) %s\n", lua_tostring(L, -1));
//send an error message if send has not been called
if(client_fd >= 0) net_error(client_fd, 500);
|
