lkml.org 
[lkml]   [2004]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectbug in swapon.c (util-linux-2.12-r4)
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

-
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/

\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.024 / U:0.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site