Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-02-09 10:24:23


Vladimir Prus wrote:

>
> Robert,
> the attached program crashes for me, and I can't understand why.

I think I know now. The 'save_binary' method uses base64 encoding. The
RFC 3548 says that:

   The encoding process represents 24-bit groups of input bits as output
   strings of 4 encoded characters.
   ...
   Special processing is performed if fewer than 24 bits are available
   at the end of the data being encoded.

That special processing is adding of '=' symbols at the end. Now, it looks
like your base64 encoder does not deal with padding.

In my case, it generated a strings of 22 characters -- and that's no
multiple of 4. I suspect that after that, reading grabs two additional
characters, after which everything goes wrong.

What do you think?

- Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk