Re: /bin/cp: Incorrect checking the return value

2019-08-18 Thread Masato Asou
From: "Theo de Raadt" Date: Fri, 16 Aug 2019 10:01:25 -0600 > Masato Asou wrote: > >> Incorrect checking the return value of malloc and system calls in >> /bin/cp. > > The NULL vs ! checks, I cannot agree with those. Their effect is > identical and it is commonplace to use either idiom. I ac

Re: /bin/cp: Incorrect checking the return value

2019-08-16 Thread Masato Asou
From: Otto Moerbeek Date: Fri, 16 Aug 2019 13:56:37 +0200 > On Fri, Aug 16, 2019 at 05:44:35PM +0900, Masato Asou wrote: > >> Incorrect checking the return value of malloc and system calls in >> /bin/cp. >> >> ok? > > Altough I indeed prefer to check against NULL these are not incorrect, > jus

Re: /bin/cp: Incorrect checking the return value

2019-08-16 Thread Theo de Raadt
Masato Asou wrote: > Incorrect checking the return value of malloc and system calls in > /bin/cp. The NULL vs ! checks, I cannot agree with those. Their effect is identical and it is commonplace to use either idiom. As to precise-checks for system call return values of -1 or 0, vs <, for that

Re: /bin/cp: Incorrect checking the return value

2019-08-16 Thread Otto Moerbeek
On Fri, Aug 16, 2019 at 05:44:35PM +0900, Masato Asou wrote: > Incorrect checking the return value of malloc and system calls in > /bin/cp. > > ok? Altough I indeed prefer to check against NULL these are not incorrect, just bad idiom. -Otto > > Index: utils.c > ===

/bin/cp: Incorrect checking the return value

2019-08-16 Thread Masato Asou
Incorrect checking the return value of malloc and system calls in /bin/cp. ok? Index: utils.c === RCS file: /cvs/src/bin/cp/utils.c,v retrieving revision 1.48 diff -u -p -U10 -r1.48 utils.c --- utils.c 28 Jun 2019 13:34:58 -