vmod_blob flexelinting round 3

it seems I wrongly assumed that SIZE_MAX would be defined as a positive
integer, in fact it looks like (size_t)-1 was used.

Ref: 2d890940
parent 92a047ce
......@@ -532,8 +532,9 @@ vmod_sub(VRT_CTX, VCL_BLOB b, VCL_BYTES n, VCL_BYTES off)
assert(b->len > 0);
if (off < 0 || n < 0 || off > SIZE_MAX || n > SIZE_MAX) {
ERR(ctx, "size or offset negative or out of range in blob.sub()");
// XXX check for > SIZE_MAX ?
if (off < 0 || n < 0) {
ERR(ctx, "size or offset negative in blob.sub()");
return (NULL);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment