From e5b3b8ad323681a5935846e76e5342d6539490aa Mon Sep 17 00:00:00 2001 From: Dmitry Frank Date: Tue, 30 Jan 2018 15:12:49 +0200 Subject: [PATCH] Ensure not to overflow buf in udp server example PUBLISHED_FROM=413f5073b0fc267d66ce04d8d40e9e9d7abac94d --- examples/mcast_udp_server/mcast_udp_server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mcast_udp_server/mcast_udp_server.c b/examples/mcast_udp_server/mcast_udp_server.c index 6cbc7983..56884582 100644 --- a/examples/mcast_udp_server/mcast_udp_server.c +++ b/examples/mcast_udp_server/mcast_udp_server.c @@ -79,7 +79,7 @@ int main(int argc, char **argv) { mg_mgr_init(&mgr, NULL); { char listen[256]; - sprintf(listen, "udp://%s", port); + snprintf(listen, sizeof(listen), "udp://%s", port); nc = mg_bind(&mgr, listen, ev_handler); }