Subject: | Coverity finding 152144 |
Hi, I did a new Coverity run on bleadperl, and it picked up the below from Encode.
Basically it is saying that the code is checking the s for NULL (line 378) but then later (line 382) happily dereferencing the s.
Maybe the code should just give up if s is NULL?
378 dlen = (s && e && s < e) ? e-s+1 : 1;
10. Condition dst->sv_flags & 268435456, taking true branch
379 d = (U8 *) SvGROW(dst, dlen);
380
11. Condition s < e, taking true branch
381 while (s < e) {
CID 152144 (#1 of 1): Dereference after null check (FORWARD_NULL)
12. var_deref_op: Dereferencing null pointer s.
382 if (UTF8_IS_INVARIANT(*s)) {
383 *d++ = *s++;
384 continue;
385 }