From: Howard Chu Date: Wed, 23 Dec 2015 17:51:39 +0000 (+0000) Subject: Fix issue 1/7 from LMX of Qihoo 360 Codesafe Team X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71fe4f2435beaccca046dad3905840615b76b085;p=rtmpdump Fix issue 1/7 from LMX of Qihoo 360 Codesafe Team AMFProp_GetObject must make sure the prop is actually an object --- diff --git a/librtmp/amf.c b/librtmp/amf.c index 1c5f99f..b783d35 100644 --- a/librtmp/amf.c +++ b/librtmp/amf.c @@ -33,6 +33,7 @@ #include "bytes.h" static const AMFObjectProperty AMFProp_Invalid = { {0, 0}, AMF_INVALID }; +static const AMFObject AMFObj_Invalid = { 0, 0 }; static const AVal AV_empty = { 0, 0 }; /* Data is Big-Endian */ @@ -340,13 +341,19 @@ AMFProp_GetBoolean(AMFObjectProperty *prop) void AMFProp_GetString(AMFObjectProperty *prop, AVal *str) { - *str = prop->p_vu.p_aval; + if (prop->p_type == AMF_STRING) + *str = prop->p_vu.p_aval; + else + *str = AV_empty; } void AMFProp_GetObject(AMFObjectProperty *prop, AMFObject *obj) { - *obj = prop->p_vu.p_object; + if (prop->p_type == AMF_OBJECT) + *obj = prop->p_vu.p_object; + else + *obj = AMFObj_Invalid; } int