mirror of
https://github.com/gryf/wmaker.git
synced 2026-06-13 22:05:21 +02:00
wmaker: check RCreateImage() result for _NET_WM_ICON
makeRImageFromARGBData() dereferences image->data immediately after RCreateImage() without checking for NULL. A client that advertises a 20000x20000 icon makes RCreateImage() try a 1.6 GB malloc, on failure wmaker segfaults.
This commit is contained in:
committed by
Carlos R. Mafra
parent
5eb3287535
commit
aa7287efbf
@@ -408,6 +408,8 @@ static RImage *makeRImageFromARGBData(unsigned long *data)
|
||||
return NULL;
|
||||
|
||||
image = RCreateImage(width, height, True);
|
||||
if (!image)
|
||||
return NULL;
|
||||
|
||||
for (imgdata = image->data, i = 2; i < size + 2; i++, imgdata += 4) {
|
||||
pixel = data[i];
|
||||
|
||||
Reference in New Issue
Block a user