overflow if 'word' arg points to full QBUFSZ buf
This prevents a buffer overflow that was encountered during fuzzing, but the underlying issue in the caller dodip() is still pending. That appears to be the result of 'obuf' not being filled with appropriate content prior to being used at line 2343 in potion.c.
This commit is contained in:
@@ -1930,7 +1930,8 @@ getobj(
|
||||
|
||||
menuquery[0] = qbuf[0] = '\0';
|
||||
if (iflags.force_invmenu)
|
||||
Sprintf(menuquery, "What do you want to %s?", word);
|
||||
Snprintf(menuquery, sizeof menuquery,
|
||||
"What do you want to %s?", word);
|
||||
if (!allowed_choices || *allowed_choices == HANDS_SYM
|
||||
|| *buf == HANDS_SYM)
|
||||
handsbuf = getobj_hands_txt(word, qbuf);
|
||||
|
||||
Reference in New Issue
Block a user