Re: modutils-2.3.15 'insmod'

From: Keith Owens (kaos@ocs.com.au)
Date: Mon Jul 14 2003 - 06:41:01 EST


On Wed, 9 Jul 2003 11:25:11 -0400 (EDT),
"Richard B. Johnson" <root@chaos.analogic.com> wrote:
>modutils-2.3.15, and probably later, has a bug that can prevent
>modules from being loaded from initrd, this results in not
>being able to mount a root file-system. The bug assumes that
>malloc() will return a valid pointer when given an allocation
>size of zero.

Sigh :( Fixed over two years ago.

modutils Changelog. 2001-05-06 modutils 2.4.6

        * Do not assume that malloc(0) returns a pointer. Bug report by
          Kiichiro Naka, different fix by Keith Owens.

void *
xmalloc(size_t size)
{
  void *ptr = malloc(size ? size : 1);
  if (!ptr)
    {
      error("Out of memory");
      exit(1);
    }
  return ptr;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 15 2003 - 22:00:51 EST