add: tmp=end;
context: char* get_hdr_field(char* buf, char* end, struct hdr_field* hdr){	char* tmp;	char *match;	struct via_body *vb;	struct cseq_body* cseq_b;	struct to_body* to_b;	if ((*buf)=='\n' || (*buf)=='\r'){		/* double crlf or lflf or crcr */		DBG("found end of header\n");		hdr->type=HDR_EOH;		return buf;	}	tmp=parse_hname(buf, end, hdr);	if (hdr->type==HDR_ERROR){		LOG(L_ERR, "ERROR: get_hdr_field: bad header\n");		goto error;	}	switch(hdr->type){		case HDR_VIA:			vb=pkg_malloc(sizeof(struct via_body));			if (vb==0){				LOG(L_ERR, "get_hdr_field: out of memory\n");				goto error;			}			memset(vb,0,sizeof(struct via_body));			hdr->body.s=tmp;			tmp=parse_via(tmp, end, vb);			if (vb->error==VIA_PARSE_ERROR){				LOG(L_ERR, "ERROR: get_hdr_field: bad via\n");				pkg_free(vb);				goto error;			}			hdr->parsed=vb;			vb->hdr.s=hdr->name.s;			vb->hdr.len=hdr->name.len;			hdr->body.len=tmp-hdr->body.s;			break;		case HDR_CSEQ:			cseq_b=pkg_malloc(sizeof(struct cseq_body));			if (cseq_b==0){				LOG(L_ERR, "get_hdr_field: out of memory\n");				goto error;			}			memset(cseq_b, 0, sizeof(struct cseq_body));			hdr->body.s=tmp;			tmp=parse_cseq(tmp, end, cseq_b);			if (cseq_b->error==PARSE_ERROR){				LOG(L_ERR, "ERROR: get_hdr_field: bad cseq\n");				pkg_free(cseq_b);				goto error;			}			hdr->parsed=cseq_b;			hdr->body.len=tmp-hdr->body.s;			DBG("get_hdr_field: cseq <%s>: <%s> <%s>\n",					hdr->name.s, cseq_b->number.s, cseq_b->method.s);			break;		case HDR_TO:			to_b=pkg_malloc(sizeof(struct to_body));			if (to_b==0){				LOG(L_ERR, "get_hdr_field: out of memory\n");				goto error;			}			memset(to_b, 0, sizeof(struct to_body));			hdr->body.s=tmp;			tmp=parse_to(tmp, end,to_b);			if (to_b->error==PARSE_ERROR){				LOG(L_ERR, "ERROR: get_hdr_field: bad to header\n");				pkg_free(to_b);				goto error;			}			hdr->parsed=to_b;			hdr->body.len=tmp-hdr->body.s;			DBG("DEBUG: get_hdr_field: <%s> [%d]; uri=[%.*s] \n",				hdr->name.s, hdr->body.len, to_b->uri.len,to_b->uri.s);			DBG("DEBUG: to body [%.*s]\n",to_b->body.len,to_b->body.s);			break;		case HDR_CONTENTTYPE:		case HDR_CONTENTLENGTH:		case HDR_FROM:		case HDR_CALLID:		case HDR_CONTACT:		case HDR_ROUTE:   /* janakj, HDR_ROUTE was missing here */		case HDR_RECORDROUTE:		case HDR_MAXFORWARDS:		case HDR_OTHER:			/* just skip over it */			hdr->body.s=tmp;			/* find end of header */			/* find lf */			do{				match=q_memchr(tmp, '\n', end-tmp);				if (match){					match++;				}else {					tmp=end;					LOG(L_ERR,							"ERROR: get_hdr_field: bad body for <%s>(%d)\n",							hdr->name.s, hdr->type);					goto error;				}				tmp=match;			}while( match<end &&( (*match==' ')||(*match=='\t') ) );			*(match-1)=0; /*null terminate*/			hdr->body.len=match-hdr->body.s;			break;		default:			LOG(L_CRIT, "BUG: get_hdr_field: unknown header type %d\n",					hdr->type);			goto error;	}	/* jku: if \r covered by current length, shrink it */	trim_r( hdr->body );	return tmp;error:	DBG("get_hdr_field: error exit\n");	hdr->type=HDR_ERROR;	return tmp;}