Avast WEBforum

Consumer Products => Avast Free Antivirus / Premium Security (legacy Pro Antivirus, Internet Security, Premier) => Topic started by: Lars-Erik on May 10, 2004, 07:27:20 PM

Title: Chest bug - or ?
Post by: Lars-Erik on May 10, 2004, 07:27:20 PM
If I try to add MANY files to the chest (I tried to add all the mailboxes from my mail agent, also tried all files from my homepage copy, both aprox 200 files) I get a strange error message like:  "C:\WWW_Docs\||ô|+P||ô||||" The above filename is invalid".  The filename vary, but is always lots of garbage and not one of the selcted files.  Is there a bug when adding many files?  Is this somthing you could fix?
Title: Re:Chest bug - or ?
Post by: igor on May 11, 2004, 04:56:24 PM
That's strange... I tried adding a few thousands of files (it took a while, I must say) and it worked correctly. How exactly did you add the files?
Couldn't the problem be related to one particular file (having a very long filename, or contaning strange characters, or something like that)? Does the error message appears every time you try to add those files? If you add only some of them, does anything change?
Title: Re:Chest bug - or ?
Post by: Lars-Erik on May 11, 2004, 06:57:57 PM
I clicked the add button, highlighted all the files in the file selector, and clicked OK. When I tried with just a few files it worked. But with 200 it failed. I also check the files-name (all of them) after highlighting them (they all get listed in the "filename" box). I'm using Win98se
Title: Re:Chest bug - or ?
Post by: igor on May 11, 2004, 09:06:25 PM
Ah, in that case, the problem may be caused by the "open dialog" itself. I found out that there's a limit there on 256 characters - if there's more, all the input is ignored (at least it seemed to me that way, maybe the buffer on Win9x causes some problems - I will check more later).
I'd rather suggest to use drag&drop for now - there shouldn't be any limits there.
Title: Re:Chest bug - or ?
Post by: Lars-Erik on May 11, 2004, 09:25:17 PM
Alle the files names are correct in the dialog-box, I checked.
AND in the error message the PATH is right, but the error message is on some kind of strange filename.  I too guess it's some kind of overflow or something, but I have never seen this in Windows in other applications - only in avast!
Title: Re:Chest bug - or ?
Post by: igor on May 12, 2004, 01:45:42 PM
It seems that this is a problem of the Windows 98 API itself - I think it will appear with any program using the standard Open Dialog with the flags "Allow multiselect" and "Files must exist". During the check of the files existence, Windows read data outside the buffer.
In fact, this API is really crapped - the buffer for the filenames must be allocated before the function is called (i.e. before you know how long the list of files may be). In addition, MFC allocates 256 characters only... not really multiselection, I'd say :(

The only solution for this would be to replace the standard Open Dialog with a custom one.