Преглед изворни кода

netmenu: fix unterminated popover strings

s_put() copied characters without writing a NUL terminator, so the tile
titles/subtitles and the summary fallbacks could read past the copied
text into uninitialized stack bytes and render garbage.  Terminate the
string after every copy in both netmenu and the Settings app.
Johannes Zellner пре 17 часа
родитељ
комит
2f49b8441b
2 измењених фајлова са 2 додато и 0 уклоњено
  1. 1 0
      user/apps/netmenu/ucmd_netmenu.c
  2. 1 0
      user/apps/settings/ucmd_settings.c

+ 1 - 0
user/apps/netmenu/ucmd_netmenu.c

@@ -47,6 +47,7 @@ static char *s_put(char *p, const char *s)
 {
 	while (s && *s)
 		*p++ = *s++;
+	*p = '\0';
 	return p;
 }
 

+ 1 - 0
user/apps/settings/ucmd_settings.c

@@ -267,6 +267,7 @@ static char *s_put(char *p, const char *s)
 {
 	while (s && *s)
 		*p++ = *s++;
+	*p = '\0';
 	return p;
 }