Correct Password not recognized after an Incorrect Password

Summary

Id: 1426.5
Type: Bug Bug
Current Status: Open

Detail

3 Nov 2003 Open Nigel Reed

I was playing with the Unzip source code and found an error on password protected zip files. The problem I got was if an incorrect password was input and then the correct password was input. If the incorrect password was longer than the correct password, the unzip failed.

Also, the pwd.ch array whilst it is declared as 255 is not that long in Wiz_SingleEntryUnzip, so I have limited the password to 50 characters. Do you know what the maximum size of a pssword is?

I put the following in UnzipPasswordCallBack of the munzip.bas file

    'clear out the password buffer
    'this is done because if an incorrect password is passed and then the correct password is passed,
    'remnants of the incorrect password are in the password buffer if the incorrect password
    'is longer than the correct password.
    For i = 0 To 50
        pwd.ch(i) = 0
    Next

Regards

Nigel Reed

Principal Consultant

Real Solutions

http://www.realsol.com.au