The Unarchiver (1000)

262 Name: Anonymous : 2007-03-02 11:57 ID:Mbbw6qgF [Del]

Re: 256

I can't give you a test case file (too large, for one thing.) However, here is the problem:

--- /tmp/TheUnarchiver1.3_src/libxad/portable/mac/XADArchive.m 2006-11-24 09:22:52.000000000 -0800
+++ /tmp/TheUnarchiver1.5_src/libxad/portable/mac/XADArchive.m 2007-02-08 17:40:46.000000000 -0800
@@ -1053,7 +1069,8 @@

    else if(detected_encoding) encoding=detected_encoding;
else encoding=NSWindowsCP1252StringEncoding;
  •   return [password cStringUsingEncoding:encoding];
  •   return [[password dataUsingEncoding:encoding] bytes];

+// return [password cStringUsingEncoding:encoding];
}

Clients of _encodedPassword (i.e. xadFileUnArc) require that the password be maintained as a null-terminated C string. (This means you can't use any encodings which might have embedded nulls as part of the encoding.) Also, dataUsingEncoding won't null-terminate the data. If a null char happens to immediately follow the data then the password works, but if not then the string continues until a null is reached, and so the password is (often) wrong.

Going back to cStringUsingEncoding for the password works just fine, since it appears xadFileUnArc can't handle anything else.

This thread has been closed. You cannot post in this thread any longer.