Andries Brouwer wrote: >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 >- >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/ > Sorav Bansal wrote: Subject: bug in swapon.c (util-linux-2.12-r4) From: Sorav Bansal Date: Thu, 16 Dec 2004 14:26:22 -0800 (PST) To: linux-kernel@vger.kernel.org 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