Jelajahi Sumber

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 22 jam lalu
induk
melakukan
2f49b8441b
2 mengubah file dengan 2 tambahan dan 0 penghapusan
  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;
 }