--- a/misc/libphysfs/archiver_zip.c Fri Sep 01 11:24:18 2017 -0400
+++ b/misc/libphysfs/archiver_zip.c Sun Sep 03 19:09:30 2017 +0200
@@ -972,8 +972,8 @@
BAIL_IF_MACRO(!retval, PHYSFS_ERR_OUT_OF_MEMORY, NULL);
memset(retval, '\0', sizeof (*retval));
retval->name = ((char *) retval) + sizeof (ZIPentry);
- memcpy(retval->name, name, namelen);
- retval->name[namelen] = '\0';
+ memcpy(retval->name, name, namelen - 1);
+ retval->name[namelen - 1] = '\0';
retval->resolved = ZIP_DIRECTORY;
if (!zip_hash_entry(info, retval))
{