File fix_wrong_string_null_terminated.patch of Package rdesktop
Extracted from Github pull request #375, and fixed to use tmppath twice as variable name and for sizeof(). --- rdesktop-1.9.0/rdesktop.c.orig 2019-09-11 16:33:07.000000000 +0200 +++ rdesktop-1.9.0/rdesktop.c 2024-01-11 14:42:25.416099137 +0100 @@ -1986,7 +1986,7 @@ save_licence(unsigned char *data, int le path[sizeof(path) - 1] = '\0'; snprintf(tmppath, PATH_MAX, "%s.new", path); - path[sizeof(path) - 1] = '\0'; + tmppath[sizeof(tmppath) - 1] = '\0'; fd = open(tmppath, O_WRONLY | O_CREAT | O_TRUNC, 0600); if (fd == -1)