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
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
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
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
> ===
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 -