mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
fix stack buffer overflow if icon pic is broken
Origin commit data
------------------
Commit: d8d07eddf7
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2019-03-09 (Sat, 09 Mar 2019)
This commit is contained in:
@@ -808,7 +808,7 @@ fb_pixel_t * CPictureViewer::int_getImage(const std::string & name, int *width,
|
||||
if (access(name.c_str(), R_OK) == -1)
|
||||
return NULL;
|
||||
|
||||
int x, y, load_ret, bpp = 0;
|
||||
int x = 0, y = 0, load_ret = 0, bpp = 0;
|
||||
CFormathandler *fh = NULL;
|
||||
unsigned char * buffer = NULL;
|
||||
fb_pixel_t * ret = NULL;
|
||||
@@ -820,6 +820,10 @@ fb_pixel_t * CPictureViewer::int_getImage(const std::string & name, int *width,
|
||||
mode_str = "getIcon";
|
||||
|
||||
fh = fh_getsize(name.c_str(), &x, &y, INT_MAX, INT_MAX);
|
||||
if (x < 1 || y < 1){
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t bufsize = x * y * 4;
|
||||
if (!checkfreemem(bufsize))
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user