There are cases wher that code is bulletproof. But it's still ugly.
-- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of Paul Gilmartin [0000000433f07816-dmarc-requ...@listserv.ua.edu] Sent: Monday, February 8, 2021 12:55 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: LINK vs LOAD/CALL On 2021-02-08, at 09:59:44, Seymour J Metz wrote: > > If the calculated address is always the same then there is no TOCTTOU issue, > but I still consider it bad form. > As wrtten, no TOCTTOU. But if the address is re-fetched elsewhere in the module, TOCTTOU threatens. The test must be performed not just once at entry, but at every reference. > ________________________________________ >> On Sun, 7 Feb 2021 19:04:16 +0000 "Gibney, Dave" wrote: >> ... >> :>Classic "bad" code >> :>IF address = 0 >> :> Determine and store address >> :>End-if >> :>Branch to address >> > Beware TOCTTOU! -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN