linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bug in swapon.c (util-linux-2.12-r4)
@ 2004-12-16 22:26 Sorav Bansal
  2004-12-16 23:35 ` Andries Brouwer
  0 siblings, 1 reply; 2+ messages in thread
From: Sorav Bansal @ 2004-12-16 22:26 UTC (permalink / raw)
  To: linux-kernel

Hi all,

There is a simple bug I noticed in swapon.c (util-linux-2.12-r4):

swapon.c line 138:
  swapFiles array is indexed without checking against NULL (after call to
  realloc)

To fix this bug, you could replace lines 135-138 by the following:
	newswapFiles = realloc(..)
	if (newSwapFiles==NULL) {
	    return;
	}
	numSwaps++;
	swapFiles = newswapFiles;
	swapFiles[numSwaps-1] = strdup(line);

regards,
-Sorav


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: bug in swapon.c (util-linux-2.12-r4)
  2004-12-16 22:26 bug in swapon.c (util-linux-2.12-r4) Sorav Bansal
@ 2004-12-16 23:35 ` Andries Brouwer
  0 siblings, 0 replies; 2+ messages in thread
From: Andries Brouwer @ 2004-12-16 23:35 UTC (permalink / raw)
  To: Sorav Bansal; +Cc: linux-kernel

On Thu, Dec 16, 2004 at 02:26:22PM -0800, Sorav Bansal wrote:
> Hi all,
> 
> There is a simple bug I noticed in swapon.c (util-linux-2.12-r4):

Thanks! However - util-linux is not part of the kernel, so this list
is not the proper place. (But I happened to see your post, so you
need not resend.)

Andries
aeb@cwi.nl

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-12-16 23:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-16 22:26 bug in swapon.c (util-linux-2.12-r4) Sorav Bansal
2004-12-16 23:35 ` Andries Brouwer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).