mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-10 16:31:44 +00:00
Fail if passed a NULL handler
Before it resulted in an endless recursion. Resolves https://github.com/cesanta/mongoose/issues/871 CL: Mongoose Web Server: Fail if passed a NULL handler to `mg_bind` or `mg_bind_opt`. PUBLISHED_FROM=376e5d330a643fa530f6a27a422a1500f986c721
This commit is contained in:
1 parent
47abc641f1
commit
0ab1c7ef76
1 file changed
+5
@@ -3046,6 +3046,11 @@ struct mg_connection *mg_bind_opt(struct mg_mgr *mgr, const char *address,
|
|||||||
opts.user_data = user_data;
|
opts.user_data = user_data;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (callback == NULL) {
|
||||||
|
MG_SET_PTRPTR(opts.error_string, "handler is required");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
MG_COPY_COMMON_CONNECTION_OPTIONS(&add_sock_opts, &opts);
|
MG_COPY_COMMON_CONNECTION_OPTIONS(&add_sock_opts, &opts);
|
||||||
|
|
||||||
#if MG_ENABLE_TUN
|
#if MG_ENABLE_TUN
|
||||||
|
|||||||
Reference in new issue
Block a user