RE: [PATCH] AArch64: Fix hwasan failure in readline.

2020-07-31 Thread Kyrylo Tkachov
Hi Tamar, > -Original Message- > From: Tamar Christina > Sent: 31 July 2020 09:07 > To: Kyrylo Tkachov ; gcc-patches@gcc.gnu.org > Cc: nd ; Richard Earnshaw ; > Marcus Shawcroft ; Richard Sandiford > > Subject: RE: [PATCH] AArch64: Fix hwasan failure in

RE: [PATCH] AArch64: Fix hwasan failure in readline.

2020-07-31 Thread Tamar Christina
Hi Kyrill, > -Original Message- > From: Kyrylo Tkachov > Sent: Friday, July 31, 2020 8:47 AM > To: Tamar Christina ; gcc-patches@gcc.gnu.org > Cc: nd ; Richard Earnshaw ; > Marcus Shawcroft ; Richard Sandiford > > Subject: RE: [PATCH] AArch64: Fix hwasan fail

RE: [PATCH] AArch64: Fix hwasan failure in readline.

2020-07-31 Thread Kyrylo Tkachov
Hi Tamar > -Original Message- > From: Tamar Christina > Sent: 30 July 2020 09:28 > To: gcc-patches@gcc.gnu.org > Cc: nd ; Richard Earnshaw ; > Marcus Shawcroft ; Kyrylo Tkachov > ; Richard Sandiford > > Subject: [PATCH] AArch64: Fix hwasan failure in rea

[PATCH] AArch64: Fix hwasan failure in readline.

2020-07-30 Thread Tamar Christina
Hi All, My previous fix added an unchecked call to fgets in the new function readline. fgets can fail when there's an error reading the file in which case it returns NULL. It also returns NULL when the next character is EOF. The EOF case is already covered by the existing code but the error case