]> granicus.if.org Git - mutt/commitdiff
The attached patch fixes a potential problem in folder_format_str()
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 9 Nov 1998 11:06:28 +0000 (11:06 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 9 Nov 1998 11:06:28 +0000 (11:06 +0000)
where a fixed buffer might not be null terminated.  From Vikas.

browser.c

index 9326a3fcc93f247586b04735b30969a01de11c1f..6eeecf2bdd783f893f9b12cb8eb87d63d406dc0d 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -172,7 +172,7 @@ folder_format_str (char *dest, size_t destlen, char op, const char *src,
       }
       break;
     case 'f':
-      strncpy (fn, folder->name, sizeof(fn) - 1);
+      strfcpy (fn, folder->name, sizeof(fn));
       if (folder->f != NULL)
       {
        strcat (fn, S_ISLNK (folder->f->st_mode) ? "@" :