bug in BSD cb(1)
chris
chris at pixutl.UUCP
Thu Oct 2 07:45:13 AEST 1986
cb(1) doesn't check for EOF while handling comments and core dumps if comment
is non-terminated (some might say 'too bad', but...)
---------------------
REPEAT BY:
% cat > /tmp/x
/*
^D
% cb < /tmp/x
---------------------
FIX: add the EOF test to the comment routine.
comment(){
rep:
while((c = string[j++] = getch()) != '*')
if(c == '\n'){
puts();
sflg = 1;
}
else if(c == EOF) {
fprintf(stderr, "error: EOF in comment\n");
exit(1);
}
gotstar:
if((c = string[j++] = getch()) != '/'){
if(c == '*')goto gotstar;
goto rep;
}
}
--
Chris Bertin : (603) 881-8791 x218
xePIX Inc. :
51 Lake St : {allegra|ihnp4|cbosgd|ima|genrad|amd|harvard}\
Nashua, NH 03060 : !wjh12!pixel!pixutl!chris
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list