]> git.pld-linux.org Git - packages/belle-sip.git/commitdiff
add the missing patch auto/th/belle-sip-1.3.0-2
authorJacek Konieczny <j.konieczny@eggsoft.pl>
Tue, 10 Jun 2014 09:21:37 +0000 (11:21 +0200)
committerJacek Konieczny <j.konieczny@eggsoft.pl>
Tue, 10 Jun 2014 09:21:37 +0000 (11:21 +0200)
use_after_free.patch [new file with mode: 0644]

diff --git a/use_after_free.patch b/use_after_free.patch
new file mode 100644 (file)
index 0000000..f8df560
--- /dev/null
@@ -0,0 +1,25 @@
+commit 2ba6eb597c2a4a99a24e3c354341fb7bb8d0d700
+Author: Jehan Monnier <jehan.monnier@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) {\
This page took 0.046716 seconds and 4 git commands to generate.