Store name and format string in internal state as their own copies rather than pointers to strings outside the state, for memory safety and to avoid a leak on remote control.

This commit is contained in:
Andrew Wood
2023-08-26 20:49:30 +01:00
parent c0abc9ce3c
commit fe22f0e449
5 changed files with 35 additions and 15 deletions
+2 -2
View File
@@ -106,9 +106,9 @@ struct pvstate_s {
int watch_fd; /* fd to watch */
unsigned int width; /* screen width */
unsigned int height; /* screen height */
/*@null@*/ const char *name; /* display name */
/*@null@*/ char *name; /* display name */
char default_format[PV_SIZEOF_DEFAULT_FORMAT]; /* default format string */
const char *format_string; /* output format string */
char *format_string; /* output format string */
/******************
* Program status *