]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix off-by-one in Joliet code.
authorAndreas Henriksson <andreas@fatal.se>
Fri, 6 Feb 2009 18:54:47 +0000 (13:54 -0500)
committerAndreas Henriksson <andreas@fatal.se>
Fri, 6 Feb 2009 18:54:47 +0000 (13:54 -0500)
Reported by Michihiro NAKAJIMA.

SVN-Revision: 571

libarchive/archive_read_support_format_iso9660.c

index c58b98053951e584bc66e8620eeb20cbb6037ba9..89939139606640a9f8b635e0b09ce584e722d4fe 100644 (file)
@@ -737,7 +737,7 @@ parse_file_info(struct iso9660 *iso9660, struct file_info *parent,
                /* convert BE UTF-16 to wchar_t */
                for (c = p, wp = wbuff;
                                c < (p + name_len) &&
-                               wp < (wbuff + sizeof(wbuff)/sizeof(*wbuff));
+                               wp < (wbuff + sizeof(wbuff)/sizeof(*wbuff) - 1);
                                c += 2) {
                        *wp++ = (((255 & (int)c[0]) << 8) | (255 & (int)c[1]));
                }