mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-19 08:03:14 +08: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:
parent
47abc641f1
commit
0ab1c7ef76
@ -3046,6 +3046,11 @@ struct mg_connection *mg_bind_opt(struct mg_mgr *mgr, const char *address,
|
||||
opts.user_data = user_data;
|
||||
#endif
|
||||
|
||||
if (callback == NULL) {
|
||||
MG_SET_PTRPTR(opts.error_string, "handler is required");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MG_COPY_COMMON_CONNECTION_OPTIONS(&add_sock_opts, &opts);
|
||||
|
||||
#if MG_ENABLE_TUN
|
||||
|
Loading…
Reference in New Issue
Block a user