The first byte of an incoming data PDU was sometimes erroneously ignored

This commit is contained in:
Pierre Pronchery 2010-06-03 13:22:29 +00:00
parent ecd286b522
commit 90c6e5c1d3

View File

@ -1632,7 +1632,8 @@ static char * _cmgr_pdu_parse_encoding_data(char const * pdu, size_t len,
if((p = malloc((len - i) * 2)) == NULL) /* XXX 4 times big enough? */ if((p = malloc((len - i) * 2)) == NULL) /* XXX 4 times big enough? */
return NULL; return NULL;
/* FIXME actually parse the header */ /* FIXME actually parse the header */
i += 2 + (hdr * 2); if(hdr != 0)
i += 2 + (hdr * 2);
for(j = 0; i + 1 < len; i+=2) for(j = 0; i + 1 < len; i+=2)
{ {
if(sscanf(&pdu[i], "%02X", &u) != 1) if(sscanf(&pdu[i], "%02X", &u) != 1)