Repository navigation
Commit a8782c9
committed
Fix: curses popup-dialog getline bypassed debug_fuzzer hook.
Fuzzing in curses mode runs pretty slowly, but I was consistently
watching the fuzzer stall after only a few turns. This commit addresses
that issue.
* win/curses/cursdial.c: the popup_dialog branch of
curses_line_input_dialog() called wgetnstr() to read the answer,
but wgetnstr() reads real PTY stdin and bypasses the
curses_getch() -> randomkey() fuzz hook used by every other
curses input path. So once popup_dialog was toggled on, any
getlin() prompt (e.g. setting compound options like packorder or
fruit name from the in-game options menu) hung the fuzzer
indefinitely. Replace wgetnstr() with a hand-rolled curses_getch()
loop that mirrors the special-key handling in
curses_message_win_getline(): ENTER/RETURN accept, ESC returns
"\033", backspace / erase_char / KEY_BACKSPACE / KEY_DC erase the
previous char, kill_char (when a control char) clears the line,
ERR returns empty. Drop the echo() / noecho() toggle since each
char is now drawn manually via mvwaddch(). Real users with
popup_dialog on see no functional change beyond ESC reliably
cancelling the prompt and ^U being honored uniformly with the
non-popup path.1 parent b1c0a16 commit a8782c9
2 files changed
Lines changed: 57 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5450 | 5450 | | |
5451 | 5451 | | |
5452 | 5452 | | |
| 5453 | + | |
5453 | 5454 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
193 | 245 | | |
194 | 246 | | |
195 | 247 | | |
196 | 248 | | |
197 | | - | |
198 | 249 | | |
199 | 250 | | |
200 | 251 | | |
| |||
0 commit comments