@schiramchetty

When you say you're only copying ... are you assuming that the length is always the same?

#define SCA_STR_COPY(str1, str2)               \
	memcpy((str1)->s, (str2)->s, (str2)->len); \
	(str1)->len = (str2)->len;

SCA_STR_COPY doesn't do any magic. You need to check that you have enough memory reserved for that. And on top of that, why should I copy a value that is exactly the same? So before copying we need to check the value is different.

Hi @linuxmaniac, Please refer to line number 907 in sca_subscribe.c file, The existing code used to copy the RR in the below line ...

SCA_STR_COPY(&update_sub->rr, &saved_sub->rr);

The same code we are used to update the new RR. Please note that in our scenario the updated RR and saved RR are different. Still, if you feel the code needs validation can you please add the validation code here. So that I will be able to raise the PR with the modified code.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/pull/3569/c1725129173@github.com>