Эх сурвалжийг харах

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 20 цаг өмнө
parent
commit
2f49b8441b

+ 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;
 }