Commit 083923b8 authored by Jozef Kralik's avatar Jozef Kralik Committed by Kishen Maloor

cloud_tests: fix possibilities to invalid read datas from buffers

apps/cloud_certification_tests.c:347:40: error: ‘%s’ directive writing up to 255 bytes into a region of size 245 [-Werror=format-overflow=]
  347 |   sprintf(endpoint_string, "coap+tcp://%s", addr)
parent 022dfafa
Pipeline #922 passed with stage
in 6 minutes and 45 seconds
......@@ -340,8 +340,10 @@ cloud_send_ping(void)
{
PRINT("\nEnter receiving endpoint: ");
char addr[256];
memset(addr, 0, sizeof(addr));
SCANF("%255s", addr);
char endpoint_string[267];
memset(endpoint_string, 0, sizeof(addr));
sprintf(endpoint_string, "coap+tcp://%s", addr);
oc_string_t ep_string;
oc_new_string(&ep_string, endpoint_string, strlen(endpoint_string));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment