aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2022-05-11 09:16:01 +0200
committerPierre Ossman <ossman@cendio.se>2022-05-11 09:16:01 +0200
commite65877b9fbd6112c680f518946c33194aef7edf1 (patch)
tree59af60ccaab77e08e660e5fc7faa672b90ada3cb /vncviewer
parent6e762cd21765d441694c119765ae06d63d1978d2 (diff)
downloadtigervnc-e65877b9fbd6112c680f518946c33194aef7edf1.tar.gz
tigervnc-e65877b9fbd6112c680f518946c33194aef7edf1.zip
Safer allocation of icon array
Avoid the risk of the list of sizes and the list of icons getting out of sync and causing memory corruption.
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/vncviewer.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx
index 3a7319c6..bbc7e372 100644
--- a/vncviewer/vncviewer.cxx
+++ b/vncviewer/vncviewer.cxx
@@ -357,7 +357,7 @@ static void init_fltk()
#elif ! defined(__APPLE__)
const int icon_sizes[] = {48, 32, 24, 16};
- Fl_PNG_Image *icons[4];
+ Fl_PNG_Image *icons[sizeof(icon_sizes)/sizeof(icon_sizes[0])];
int count;
count = 0;