Ensure that the name buffer is null-terminated

CL: none

PUBLISHED_FROM=f165b556582f712c2c1c752e01c41d22fe593397
This commit is contained in:
Dmitry Frank 2018-01-30 19:22:11 +02:00 committed by Cesanta Bot
parent 33f53ab000
commit 8e366916d5

View File

@ -11699,6 +11699,8 @@ int mg_resolve_async_opt(struct mg_mgr *mgr, const char *name, int query,
}
strncpy(req->name, name, sizeof(req->name));
req->name[sizeof(req->name) - 1] = '\0';
req->query = query;
req->callback = cb;
req->data = data;