[Bug 57080] New: conn-avatar : segfault - too small base64 string allocation

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Nov 13 19:01:18 CET 2012


https://bugs.freedesktop.org/show_bug.cgi?id=57080

          Priority: medium
            Bug ID: 57080
          Assignee: telepathy-bugs at lists.freedesktop.org
           Summary: conn-avatar : segfault - too small base64 string
                    allocation
        QA Contact: telepathy-bugs at lists.freedesktop.org
          Severity: major
    Classification: Unclassified
                OS: All
          Reporter: prahal at yahoo.com
          Hardware: Other
            Status: NEW
           Version: git master
         Component: gabble
           Product: Telepathy

Created attachment 70014
  --> https://bugs.freedesktop.org/attachment.cgi?id=70014&action=edit
fix base64 allocated length

As per g_base64 documentation the minimum size is :
avatar->len / 3 + 1) *4 + 4)
and if line breaks are enabled:
+  ((avatar->len / 3 + 1) * 4 + 4) / 72 + 1

Currently in gdb I see outlen 3551 with base64 allocated with around 3501
bytes.
This comes from the use of :
(avatar->len / 3 + 1) * 4 + 1
as length to allocate to the base64 string.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list