misc fixes for mms decoding PANICs
This commit is contained in:
parent
6445ca1403
commit
5b5fa1fd7b
|
@ -1,4 +1,6 @@
|
|||
2008-07-01 P. A. Bagyenda
|
||||
2008-07-04 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||
* Minor fixes for PANICs in mms_msg.c
|
||||
2008-07-01 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||
* Minor fix to MM4 interface -- address formatting fix
|
||||
2008-06-27 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||
* Minor fix to MM4 .RES handling: use proxy sendmail command if present
|
||||
|
|
|
@ -320,8 +320,10 @@ static int mms_unpack_well_known_field(List *unpacked, int field_type,
|
|||
decoded = wsp_unpack_integer_value(context);
|
||||
|
||||
ret2= wsp_field_value(context, &val);
|
||||
octstr_append(decoded, decode_encoded_string_value(ret2, context, hname));
|
||||
|
||||
if (decoded)
|
||||
octstr_append(decoded, decode_encoded_string_value(ret2, context, hname));
|
||||
else
|
||||
warning(0, "Error decoding Header-Response-Text header value");
|
||||
if (ret2 == WSP_FIELD_VALUE_DATA) { /* we need to skip to end of inner value-data. */
|
||||
parse_skip_to_limit(context);
|
||||
parse_pop_limit(context);
|
||||
|
@ -347,7 +349,12 @@ static int mms_unpack_well_known_field(List *unpacked, int field_type,
|
|||
Octstr *t;
|
||||
decoded = wsp_unpack_integer_value(context);
|
||||
t = parse_get_nul_string(context);
|
||||
octstr_append(decoded, t);
|
||||
if (decoded)
|
||||
octstr_append(decoded, t);
|
||||
else
|
||||
warning(0, "error decoding value for header %s\n",
|
||||
hname);
|
||||
|
||||
octstr_destroy(t);
|
||||
} else if (ret != WSP_FIELD_VALUE_NUL_STRING)
|
||||
warning(0, "Unexpected field value type %d for header %s\n",
|
||||
|
@ -392,8 +399,11 @@ static int mms_unpack_well_known_field(List *unpacked, int field_type,
|
|||
wsp_field_value(context, &val);
|
||||
x = mms_response_status_to_cstr(val|0x80);
|
||||
|
||||
octstr_append_cstr(decoded, (char *)x);
|
||||
|
||||
if (decoded)
|
||||
octstr_append_cstr(decoded, (char *)x);
|
||||
else
|
||||
warning(0, "error decoding field_value_data value for header %s\n",
|
||||
hname);
|
||||
} else
|
||||
ch = mms_response_status_to_cstr(val|0x80);
|
||||
break;
|
||||
|
@ -432,7 +442,6 @@ static int mms_unpack_well_known_field(List *unpacked, int field_type,
|
|||
ch = wsp_content_type_to_cstr(val);
|
||||
else if (ret == WSP_FIELD_VALUE_DATA)
|
||||
decoded = wsp_unpack_accept_general_form(context);
|
||||
|
||||
break;
|
||||
|
||||
case MMS_HEADER_DELIVERY_TIME:
|
||||
|
@ -491,8 +500,11 @@ static int mms_unpack_well_known_field(List *unpacked, int field_type,
|
|||
t = decode_encoded_string_value(-1, context, hname);
|
||||
else
|
||||
t = wsp_unpack_date_value(context);
|
||||
|
||||
octstr_append(decoded, t);
|
||||
if (decoded)
|
||||
octstr_append(decoded, t);
|
||||
else
|
||||
warning(0, "error decoding value for header %s!",
|
||||
hname);
|
||||
octstr_destroy(t);
|
||||
}
|
||||
break;
|
||||
|
@ -548,7 +560,10 @@ static int mms_unpack_well_known_field(List *unpacked, int field_type,
|
|||
else {
|
||||
int n = parse_get_char(context);
|
||||
decoded = wsp_unpack_integer_value(context);
|
||||
octstr_format_append(decoded, " %s", (n == 0x80) ? "msgs" : "bytes");
|
||||
if (decoded)
|
||||
octstr_format_append(decoded, " %s", (n == 0x80) ? "msgs" : "bytes");
|
||||
else
|
||||
warning(0, "error decoding value for header %s!\n", hname);
|
||||
}
|
||||
break;
|
||||
case MMS_HEADER_MM_FLAGS:
|
||||
|
|
Loading…
Reference in New Issue