[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-inetutils] Anomalies in the code
From: |
Sergey Poznyakoff |
Subject: |
Re: [bug-inetutils] Anomalies in the code |
Date: |
Thu, 08 May 2008 11:51:43 +0300 |
Debarshi Ray <address@hidden> ha escrit:
> unsigned char *
> env_default (int init, int welldefined)
> {
> static struct env_lst *nep = NULL;
>
> if (init)
> {
> nep = &envlisthead;
> return;
It is safe to return NULL here. When env_default is called
with init=1, its return value is ignored anyway.
As a side note, there is a more serious bug in env_define,
command.c:1918. The return value from malloc is not tested,
which can lead to a coredump. I'd propose to change it to
xmalloc to be on a safe side.
Regards,
Sergey