besm6_punch.c
Jun. 27th, 2019 03:51 pmCoverity сообщает о потенциальной баге в simh. Правда я не могу понять, чего он хочет.
From: <scan-admin@coverity.com>
Date: Tue, 19 Feb 2019 23:47
Subject: New Defects reported by Coverity Scan for simh/simh
To: <serge@vak.ru>
Hi,
Please find the latest report on new defect(s) introduced to simh/simh found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan*** CID 1477057: (TAINTED_SCALAR) /BESM6/besm6_punch.c: 250 in fs_event() 244 /* Switching from running text mode to "virtual punchcard" mode and back 245 * is done with an ASCII GS (group separator) symbol ctrl-]. 246 */ 247 fs_state[num] = FS_IMAGE; 248 goto again; 249 } else { >>> CID 1477057: (TAINTED_SCALAR) >>> Passing tainted variable "ch" to a tainted sink. 250 FS[num] = unicode_to_upp (ch); 251 } 252 } else if (FS_IMAGE <= fs_state[num] && fs_state[num] <= FS_IMAGE_LAST) { 253 int ch = utf8_getc (u->fileref); 254 if (ch < 0) { 255 /* premature end of tape */ /BESM6/besm6_punch.c: 271 in fs_event() 265 } else if (ch == (']' & 037)) { 266 if (fs_state[num] != FS_IMAGE) 267 besm6_debug("<<< ENDA3 requested mid-card?"); 268 fs_state[num] = FS_ENDA3; 269 goto again; 270 } else { >>> CID 1477057: (TAINTED_SCALAR) >>> Passing tainted variable "ch" to a tainted sink. 271 FS[num] = unicode_to_upp (ch); 272 if (++fs_state[num] == FS_TOOLONG) { 273 /* If a line is too long (> 120 chars), start the next "virtual punchcard" */ 274 fs_state[num] = FS_IMAGE; 275 } 276 }