DF-4133 / fix.diff
--- a/sys/dev/raid/vinum/vinumio.c +++ b/sys/dev/raid/vinum/vinumio.c @@ -795,7 +795,9 @@ for (cptr = config_text; *cptr != '\0';) { /* love this style(9) */ volatile int parse_status; /* return value from parse_config */ - for (eptr = config_line; (*cptr != '\n') && (*cptr != '\0');) /* until the end of the line */ + for (eptr = config_line; /* until the end of the line, */ + (*cptr != '\n') && (*cptr != '\0') /* but never write past the */ + && (eptr < &config_line[MAXCONFIGLINE * 2 - 1]);) /* end of config_line */ *eptr++ = *cptr++; *eptr = '\0'; /* and delimit */ if (setjmp(command_fail) == 0) { /* come back here on error and continue */ |