[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#175323: marked as done (udhcpd: Malloc'ed memory not checked for successful allocation)



Your message dated Wed, 08 Dec 2010 22:02:46 +0300
with message-id <4CFFD656.8010601@msgid.tls.msk.ru>
and subject line Re: Bug#175323: udhcpd: Malloc'ed memory not checked for successful allocation
has caused the Debian Bug report #175323,
regarding udhcpd: Malloc'ed memory not checked for successful allocation
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
175323: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=175323
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: udhcpd
Version: 0.9.8-2 (not installed)
Severity: minor

It appears as if none of tha malloc (and xmalloc, which appears to be
#defined to malloc) return values are checked for NULL, but they are all
used indiscriminately.

I don't use udhcp myself, so I won't be able to create and test a patch, but
the most obvious way to do it is to do a 

  foo = malloc(23);
+  if(!foo)
+     exit_client(1);

Exchange exit_client for exit_server where applicable, and set a reasonable
exit-code (I don't know if udhcp has a system for which exit codes to use)

It is possible that when compiled inside busybox (which it is created to do,
as far as I can see) xmalloc is replaced with a fail-safe malloc - I didn't
have time to check.


-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux frode.valhall.no 2.4.20 #1 SMP Sun Dec 1 15:51:30 CET 2002 i686
Locale: LANG=no_NO.ISO-8859-1, LC_CTYPE=no_NO.ISO-8859-1



--- End Message ---
--- Begin Message ---
Version: 1:1.17.1-8

04.01.2003 20:56, Håvard Lygre wrote:
> Package: udhcpd
> Version: 0.9.8-2 (not installed)
> Severity: minor
> 
> It appears as if none of tha malloc (and xmalloc, which appears to be
> #defined to malloc) return values are checked for NULL, but they are all
> used indiscriminately.
> 
> I don't use udhcp myself, so I won't be able to create and test a patch, but
> the most obvious way to do it is to do a 
> 
>   foo = malloc(23);
> +  if(!foo)
> +     exit_client(1);

During amost 8 years of development, all malloc-like calls
in busybox are now (as of version 1:1.17.1-8) replaced with
xmalloc(), which aborts if null pointer is returned.

So closing this bug now.

Thanks!

/mjt


--- End Message ---

Reply to: