diff -aur sofia-sip-1.12.11.pristine/libsofia-sip-ua/msg/msg_parser.c sofia-sip-1.12.11.new/libsofia-sip-ua/msg/msg_parser.c --- sofia-sip-1.12.11.pristine/libsofia-sip-ua/msg/msg_parser.c 2015-03-17 15:12:22.413197247 -0500 +++ sofia-sip-1.12.11.new/libsofia-sip-ua/msg/msg_parser.c 2015-03-17 15:23:49.223178197 -0500 @@ -2468,8 +2468,6 @@ msg_header_t ** msg_hclass_offset(msg_mclass_t const *mc, msg_pub_t const *mo, msg_hclass_t *hc) { - int i; - assert(mc && hc); if (mc == NULL || hc == NULL) @@ -2484,10 +2482,21 @@ } else /* Header has no name. */ - for (i = 0; i <= 6; i++) - if (hc->hc_hash == mc->mc_request[i].hr_class->hc_hash) - return (msg_header_t **)((char *)mo + mc->mc_request[i].hr_offset); - + if (hc->hc_hash == mc->mc_request[0].hr_class->hc_hash) + return (msg_header_t **)((char *)mo + mc->mc_request[0].hr_offset); + else if (hc->hc_hash == mc->mc_status[0].hr_class->hc_hash) + return (msg_header_t **)((char *)mo + mc->mc_status[0].hr_offset); + else if (hc->hc_hash == mc->mc_separator[0].hr_class->hc_hash) + return (msg_header_t **)((char *)mo + mc->mc_separator[0].hr_offset); + else if (hc->hc_hash == mc->mc_payload[0].hr_class->hc_hash) + return (msg_header_t **)((char *)mo + mc->mc_payload[0].hr_offset); + else if (hc->hc_hash == mc->mc_unknown[0].hr_class->hc_hash) + return (msg_header_t **)((char *)mo + mc->mc_unknown[0].hr_offset); + else if (hc->hc_hash == mc->mc_error[0].hr_class->hc_hash) + return (msg_header_t **)((char *)mo + mc->mc_error[0].hr_offset); + else if (hc->hc_hash == mc->mc_multipart[0].hr_class->hc_hash) + return (msg_header_t **)((char *)mo + mc->mc_multipart[0].hr_offset); + return NULL; }