Philip Withnall 35c0dd2755 gbase64: Fix base-64 stepped encoding with small chunks
If encoding with small chunks such that the call to
g_base64_encode_close() has to deal with 0 < x < 24 bits of remaining
state, the encoding code would not correctly use zeroes to pad out the
state — it would use left-over state from an earlier iteration in the
encoding process.

This resulted in invalid base-64 encodings.

Add a unit test for incremental encoding using different sized chunks
too.

Thanks to Rainier Perske for reporting and analysing the bug.

https://bugzilla.gnome.org/show_bug.cgi?id=780066

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-03-23 15:34:11 +00:00
..
2015-06-29 08:20:26 -07:00
2010-07-10 23:56:45 -04:00
2015-08-31 13:59:48 -04:00
2014-01-31 14:31:55 +01:00
2017-02-20 12:40:26 +01:00
2014-01-31 14:31:55 +01:00
2014-10-02 14:41:01 -04:00
2010-07-05 23:43:47 -04:00
2012-04-08 10:24:52 -04:00
2011-02-13 23:49:19 -05:00
2011-10-08 19:02:06 -04:00
2014-01-31 14:31:55 +01:00
2013-11-23 00:39:07 -05:00
2010-07-07 22:03:02 -04:00
2013-11-11 22:39:57 +08:00
2014-01-31 14:31:55 +01:00
2011-10-13 01:00:57 -04:00
2015-11-26 09:26:45 -05:00
2011-01-27 23:07:53 -05:00
2014-01-31 14:31:55 +01:00
2014-01-01 17:59:22 -05:00
2011-06-03 23:38:46 -04:00
2016-08-16 10:41:46 +02:00
2014-01-31 14:31:55 +01:00
2015-09-12 11:13:45 -04:00
2014-01-31 14:31:55 +01:00
2015-08-31 13:59:48 -04:00
2014-01-01 22:39:32 -05:00
2014-01-31 14:31:55 +01:00
2016-09-21 18:31:04 +02:00
2014-01-01 17:59:21 -05:00
2014-01-31 14:31:55 +01:00