Bug 395281

Summary: g_base64_encode cannot encode one byte data
Product: [Fedora] Fedora Reporter: Milan Crha <mcrha>
Component: glib2Assignee: Matthias Clasen <mclasen>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 8   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-23 18:00:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Milan Crha 2007-11-22 07:13:09 UTC
Description of problem:
When I was testing some data in my project I realized that g_base64_encode
cannot encode data with length=1, it just returns NULL and shows a runtime
warning on console that assertion length>1 failed. I think it's obvious bug, I
should be able to encode one byte data to base64. Hence severity high.

Version-Release number of selected component (if applicable):
I'm not sure if it's in this package, but probably it is: glibc-2.7-2

Comment 1 Rex Dieter 2007-11-22 13:06:36 UTC
Reassigning glib -> glibc

Comment 2 Matthias Clasen 2007-11-23 18:00:40 UTC
Fixed in upstream svn

2007-11-23  Matthias Clasen  <mclasen@redhat.com>

        * glib/gbase64.c (g_base64_encode): Don't refuse to encode
        a single byte.  (Milan Crha)

        * tests/base64-test.c: Test encoding short strings.