X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=extlibs%2Ftinycbor%2Ftinycbor%2Fsrc%2Fextract_number_p.h;h=d6a430e184b630a0ba91ecb4457cab9f8cd5298e;hb=a350ca2fa7ac007d2871278bd25b90f378cbc70c;hp=4767cc0e66407a3631e3a73443c46606059704d3;hpb=b639c4f1420e5412956df8c8cf40e93d8b7db8a4;p=platform%2Fupstream%2Fiotivity.git diff --git a/extlibs/tinycbor/tinycbor/src/extract_number_p.h b/extlibs/tinycbor/tinycbor/src/extract_number_p.h index 4767cc0..d6a430e 100644 --- a/extlibs/tinycbor/tinycbor/src/extract_number_p.h +++ b/extlibs/tinycbor/tinycbor/src/extract_number_p.h @@ -60,7 +60,7 @@ static CborError extract_number(const uint8_t **ptr, const uint8_t *end, uint64_ return CborErrorIllegalNumber; size_t bytesNeeded = 1 << (additional_information - Value8Bit); - if (unlikely(*ptr + bytesNeeded > end)) { + if (unlikely(bytesNeeded > (size_t)(end - *ptr))) { return CborErrorUnexpectedEOF; } else if (bytesNeeded == 1) { *len = (uint8_t)(*ptr)[0];