The commit fixing the stack overflow for malformed Subnets could compare
against a NULL pointer, which works fine in practice but is undefined
behavior.
char *last_colon = strrchr(str, ':');
/* Check that the last colon is not further than possible in an IPv6 address */
char *last_colon = strrchr(str, ':');
/* Check that the last colon is not further than possible in an IPv6 address */
- if(last_colon >= str + 5 * 8) {
+ if(last_colon && last_colon >= str + 5 * 8) {