# HG changeset patch # User nicodvb # Date 1176935818 0 # Node ID 918fe20358cba8dba5faf113e36c9254e1910798 # Parent 6853c398600cb362f83ea095bebedb0a61273a81 replaced sequency of strncpy() and strncat() by 1 snprintf() and fixed off-by-1 possible buffer oveflow; patch by Diego Petteno' diff -r 6853c398600c -r 918fe20358cb remap.c --- a/remap.c Wed Apr 18 22:34:52 2007 +0000 +++ b/remap.c Wed Apr 18 22:36:58 2007 +0000 @@ -190,10 +190,7 @@ /* Build the map filename */ home = getenv("HOME"); assert(home); - strncpy(fname, home, sizeof(fname)); - strncat(fname, "/.dvdnav/", sizeof(fname)); - strncat(fname, title, sizeof(fname)); - strncat(fname, ".map", sizeof(fname)); + snprintf(fname, sizeof(fname), "%s/.dvdnav/%s.map", home, title); /* Open the map file */ fp = fopen( fname, "r");