Author: chris_y
Date: Wed Apr 18 13:54:15 2012
New Revision: 13881
URL:
http://source.netsurf-browser.org?rev=13881&view=rev
Log:
Replace strncpy with strlcpy, as strncpy is not guaranteed to be
NULL-terminated. (thx Colin Wenzel)
Modified:
trunk/netsurf/amiga/gui.c
trunk/netsurf/amiga/misc.c
Modified: trunk/netsurf/amiga/gui.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/amiga/gui.c?rev=13881&...
==============================================================================
--- trunk/netsurf/amiga/gui.c (original)
+++ trunk/netsurf/amiga/gui.c Wed Apr 18 13:54:15 2012
@@ -867,13 +867,13 @@
ami_gui_splash_close(splash_window);
- strncpy(script, nsoption_charp(arexx_dir), 1024);
+ strlcpy(script, nsoption_charp(arexx_dir), 1024);
AddPart(script, nsoption_charp(arexx_startup), 1024);
ami_arexx_execute(script);
netsurf_main_loop();
- strncpy(script, nsoption_charp(arexx_dir), 1024);
+ strlcpy(script, nsoption_charp(arexx_dir), 1024);
AddPart(script, nsoption_charp(arexx_shutdown), 1024);
ami_arexx_execute(script);
Modified: trunk/netsurf/amiga/misc.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/amiga/misc.c?rev=13881&am...
==============================================================================
--- trunk/netsurf/amiga/misc.c (original)
+++ trunk/netsurf/amiga/misc.c Wed Apr 18 13:54:15 2012
@@ -115,7 +115,7 @@
DevNameFromLock(lock, newpath, sizeof newpath, DN_FULLPATH);
UnLock(lock);
}
- else strncpy(newpath, path, sizeof newpath);
+ else strlcpy(newpath, path, sizeof newpath);
r = malloc(strlen(newpath) + SLEN("file:///") + 1);