Browse Source

bug fix, invalid read when the title line is the empty

rlar 14 years ago
parent
commit
f52ae6eccd
  1. 7
      src/frontend/inp.c
  2. 4
      src/frontend/parser/complete.c

7
src/frontend/inp.c

@ -939,7 +939,14 @@ inp_dodeck(
} // if (!noparse) . . .
/* add title of deck to data base */
/* this won't work if the title is the empty string
* cp_addkword() doesn't work for tt === ""
* since CT_CKTNAMES doesn't seem to be used anywhere
* I've disabled this piece.
*/
#if 0
cp_addkword(CT_CKTNAMES, tt);
#endif
}

4
src/frontend/parser/complete.c

@ -599,6 +599,10 @@ clookup(register char *word, struct ccom **dd, bool pref, bool create)
buf[0] = *word;
buf[1] = '\0';
place->cc_name = copy(buf);
if (word[0] == '\0') {
fprintf(stderr, "ERROR, internal error, clookup() needs fixing to process the empty string\n");
controlled_exit(EXIT_FAILURE);
}
if (word[1])
place->cc_invalid = 1;
}

Loading…
Cancel
Save