Sfoglia il codice sorgente

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 19 ore fa
parent
commit
2f49b8441b
2 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  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;
 }