[rtmpdump] branch master updated. 60218d0 fixed undefined behaviour due to union assignment

gitolite gil at avcodec.org
Fri Sep 30 20:50:31 CEST 2011


The branch, master has been updated
       via  60218d0af0f4bd683ecdebe49986f188820cf8ce (commit)
      from  6230845ab0fba07289d4b2d9b97269e4b2d90766 (commit)


- Log -----------------------------------------------------------------
commit 60218d0af0f4bd683ecdebe49986f188820cf8ce
Author:     Kirill Zorin <cyril.zorin at gmail.com>
AuthorDate: Fri Sep 30 13:38:23 2011 -0400
Commit:     Howard Chu <hyc at highlandsun.com>
CommitDate: Fri Sep 30 11:49:27 2011 -0700

    fixed undefined behaviour due to union assignment

diff --git a/librtmp/amf.c b/librtmp/amf.c
index 7fa289e..ae920e4 100644
--- a/librtmp/amf.c
+++ b/librtmp/amf.c
@@ -1111,7 +1111,7 @@ AMF_AddProp(AMFObject *obj, const AMFObjectProperty *prop)
   if (!(obj->o_num & 0x0f))
     obj->o_props =
       realloc(obj->o_props, (obj->o_num + 16) * sizeof(AMFObjectProperty));
-  obj->o_props[obj->o_num++] = *prop;
+  memcpy(&obj->o_props[obj->o_num++], prop, sizeof(AMFObjectProperty));
 }
 
 int
diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c
index 5311a8a..4b17a49 100644
--- a/librtmp/rtmp.c
+++ b/librtmp/rtmp.c
@@ -2584,7 +2584,7 @@ RTMP_FindFirstMatchingProperty(AMFObject *obj, const AVal *name,
 
       if (AVMATCH(&prop->p_name, name))
 	{
-	  *p = *prop;
+	  memcpy(p, prop, sizeof(*prop));
 	  return TRUE;
 	}
 
@@ -2610,7 +2610,7 @@ RTMP_FindPrefixProperty(AMFObject *obj, const AVal *name,
       if (prop->p_name.av_len > name->av_len &&
       	  !memcmp(prop->p_name.av_val, name->av_val, name->av_len))
 	{
-	  *p = *prop;
+	  memcpy(p, prop, sizeof(*prop));
 	  return TRUE;
 	}
 

-----------------------------------------------------------------------

Summary of changes:
 librtmp/amf.c  |    2 +-
 librtmp/rtmp.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)


hooks/post-receive
-- 



More information about the rtmpdump mailing list