Jump to content

Base64 decoding problem and Open G zip error combo


Mads

Recommended Posts

I am using the Open G POP functions to fetch and decode e-mails with attached zip files, and have run into a rather "fun" combination of errors:

1. If the (zip) file has two zero-bytes at the end it will be reflected in the base64-encoded data, however only one of them will come through when the OpenG base64 decoding is applied.

2. If a zip file lacks that final zero-byte the OpenG unzip-functions (i.e. the dll they use) will crash.

So - in my case my code receives and writes a zip file, and that zip file is read and decompressed just fine with other zip-software, however because the same software is trying to use the OpenG unzip function it ends up crashing the whole software....

I can probably figure out a way to edit the decoder so that it does not lose any bytes (perhaps this is a known issue that is routinely solved?), however it is still a bit uncomfortable to know that the unzip function is possible to crash by feeding it a file with such an error.

Mads

Link to comment

I can't help you with the zip file issue, but if you want to try a different base64 encoder/decoder and see how that works, you can get the ones that are part of the XML-RPC Server for LabVIEW in the Code Repository (http://forums.lavag.org/XML-RPC-Server-for-LabVIEW-file156.html). The XML-RPC standard must support base64 encoding/decoding so I wrote these implementations for that toolkit.

Mark

Link to comment

Superb, your base64 code did the trick, thanks :)

As for the weakness in the unzip-function I tried downloading the latest version (mine was the previous version) and to my luck the issue seems to have been adressed there, so now absolutely everything works as it should :thumbup: :thumbup:

PS. The OpenG base64 decoder still has this problem, that code is not maintained anymore (I think(?))...so replacing it, e.g. with Mark's code, might be useful for others as well.

Mads

QUOTE (mesmith @ Jan 15 2009, 02:54 PM)

I can't help you with the zip file issue, but if you want to try a different base64 encoder/decoder and see how that works, you can get the ones that are part of the XML-RPC Server for LabVIEW in the Code Repository (http://forums.lavag.org/XML-RPC-Server-for-LabVIEW-file156.html). The XML-RPC standard must support base64 encoding/decoding so I wrote these implementations for that toolkit.

Mark

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.