[sr-dev] [kamailio/kamailio] pv_headers: fix possible mem. overflow issue and wrong size string (PR #3095)

Tomohare notifications at github.com
Fri Apr 29 17:09:14 CEST 2022


@Tomohare commented on this pull request.



>  		}
 	}
 
 	if (elements->len-toRemove->len > 0)
 	{
-		snprintf(elements->s, elements->len, "%*s", elements->len-toRemove->len, "");
+		memset(elements->s, 32, elements->len - toRemove->len);
 		snprintf(elements->s, (strlen(result)%elements->len)+1, "%s", result);

As above, this is not needed here.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3095#discussion_r861897478
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/3095/review/957879454 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20220429/1486b74e/attachment.htm>


More information about the sr-dev mailing list