[packages/belle-sip] add the missing patch

jajcus jajcus at pld-linux.org
Tue Jun 10 11:21:52 CEST 2014


commit 8e798250e19f49fc92011abb6c79919e35a0feef
Author: Jacek Konieczny <j.konieczny at eggsoft.pl>
Date:   Tue Jun 10 11:21:37 2014 +0200

    add the missing patch

 use_after_free.patch | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
---
diff --git a/use_after_free.patch b/use_after_free.patch
new file mode 100644
index 0000000..f8df560
--- /dev/null
+++ b/use_after_free.patch
@@ -0,0 +1,25 @@
+commit 2ba6eb597c2a4a99a24e3c354341fb7bb8d0d700
+Author: Jehan Monnier <jehan.monnier at linphone.org>
+Date:   Mon Jun 2 16:32:15 2014 +0200
+
+    Change BELLE_SIP_SET_STRING macro to allow code  like obj_set_value(obj,obj_get_value(obj))
+
+diff --git a/src/belle_sip_internal.h b/src/belle_sip_internal.h
+index b6d39f1..66a5023 100644
+--- a/src/belle_sip_internal.h
++++ b/src/belle_sip_internal.h
+@@ -286,11 +286,12 @@ BELLESIP_INTERNAL_EXPORT unsigned int belle_sip_random(void);
+ 		return obj->attribute;\
+ 	}\
+ 	void object_type##_set_##attribute (object_type##_t* obj,const char* value) {\
+-		if (obj->attribute != NULL) belle_sip_free((void*)obj->attribute);\
++		const char* previous_value = obj->attribute;  /*preserve if same value re-asigned*/ \
+ 		if (value) {\
+ 			obj->attribute=belle_sip_strdup(value); \
+ 		} else obj->attribute=NULL;\
+-	}
++		if (previous_value != NULL) belle_sip_free((void*)previous_value);\
++}
+ /*#define GET_SET_STRING_PARAM_NULL_ALLOWED(object_type,attribute) \
+ 	GET_STRING_PARAM2(object_type,attribute,attribute) \
+ 	void object_type##_set_##func_name (object_type##_t* obj,const char* value) {\
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/belle-sip.git/commitdiff/8e798250e19f49fc92011abb6c79919e35a0feef



More information about the pld-cvs-commit mailing list