Holger Hans Peter Freyther | 87c73f7 | 2016-01-08 13:01:03 +0100 | [diff] [blame] | 1 | --- sofia-sip-1.12.11+20110422.1.orig/libsofia-sip-ua/msg/msg_parser.c |
| 2 | +++ sofia-sip-1.12.11+20110422.1/libsofia-sip-ua/msg/msg_parser.c |
| 3 | @@ -2468,8 +2468,6 @@ |
| 4 | msg_header_t ** |
| 5 | msg_hclass_offset(msg_mclass_t const *mc, msg_pub_t const *mo, msg_hclass_t *hc) |
| 6 | { |
| 7 | - int i; |
| 8 | - |
| 9 | assert(mc && hc); |
| 10 | |
| 11 | if (mc == NULL || hc == NULL) |
| 12 | @@ -2484,9 +2482,20 @@ |
| 13 | } |
| 14 | else |
| 15 | /* Header has no name. */ |
| 16 | - for (i = 0; i <= 6; i++) |
| 17 | - if (hc->hc_hash == mc->mc_request[i].hr_class->hc_hash) |
| 18 | - return (msg_header_t **)((char *)mo + mc->mc_request[i].hr_offset); |
| 19 | + if (hc->hc_hash == mc->mc_request[0].hr_class->hc_hash) |
| 20 | + return (msg_header_t **)((char *)mo + mc->mc_request[0].hr_offset); |
| 21 | + else if (hc->hc_hash == mc->mc_status[0].hr_class->hc_hash) |
| 22 | + return (msg_header_t **)((char *)mo + mc->mc_status[0].hr_offset); |
| 23 | + else if (hc->hc_hash == mc->mc_separator[0].hr_class->hc_hash) |
| 24 | + return (msg_header_t **)((char *)mo + mc->mc_separator[0].hr_offset); |
| 25 | + else if (hc->hc_hash == mc->mc_payload[0].hr_class->hc_hash) |
| 26 | + return (msg_header_t **)((char *)mo + mc->mc_payload[0].hr_offset); |
| 27 | + else if (hc->hc_hash == mc->mc_unknown[0].hr_class->hc_hash) |
| 28 | + return (msg_header_t **)((char *)mo + mc->mc_unknown[0].hr_offset); |
| 29 | + else if (hc->hc_hash == mc->mc_error[0].hr_class->hc_hash) |
| 30 | + return (msg_header_t **)((char *)mo + mc->mc_error[0].hr_offset); |
| 31 | + else if (hc->hc_hash == mc->mc_multipart[0].hr_class->hc_hash) |
| 32 | + return (msg_header_t **)((char *)mo + mc->mc_multipart[0].hr_offset); |
| 33 | |
| 34 | return NULL; |
| 35 | } |