@miconda commented on this pull request.


In src/modules/siptrace/siptrace.c:

>  
 		/* could use the dest_info we've already parsed but there's no way to pass
 		 * it to DLGCB_CREATED callback so the only thing to do is keep
 		 * it as uri, serialize in a dlg_var and parse again in DLGCB_CREATED */
 		if(corid) {
-			info->correlation_id = *corid;
+			info->correlation_id.s = (char *)(info + 1);

Arithmetics with pointers is ok, adding 1 is practically adding the size of respective structure to the initial address. In old times, arithmetic operation with pointers was known to be safe when the pointer was referring to an array element, therefore I preferred to do cast to char* for initial pointer and then add sizeof(struct), like: (char*)info + sizeof(siptrace_info_t). With modern compilers gcc/clang, I expect to be all fine with (char*)(info + 1), I think it is in other parts of the code anyhow.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.