Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 73425 - g_string_printf loses data on embeded '\0' in certain cases
g_string_printf loses data on embeded '\0' in certain cases
Product: Red Hat Linux
Classification: Retired
Component: glib2 (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Owen Taylor
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2002-09-04 11:53 EDT by James Antill
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-10-31 20:34:12 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Source of program to show bug. (553 bytes, patch)
2002-09-04 11:54 EDT, James Antill
no flags Details | Diff
Proposed patch. (584 bytes, patch)
2002-09-04 11:55 EDT, James Antill
no flags Details | Diff

  None (edit)
Description James Antill 2002-09-04 11:53:29 EDT
Description of Problem:

 If you call g_mem_set_vtable() then on a system with vasprintf() you will lose
data if you call g_string_printf() with a '\0' byte in the data.

Version-Release number of selected component (if applicable):

How Reproducible:

Steps to Reproduce:
1. See attached program.

Actual Results:
 attached source dies.

Expected Results:
 should exit cleanly.

Additional Information:
 I've also attached a patch to fix the problem.
Comment 1 James Antill 2002-09-04 11:54:21 EDT
Created attachment 74884 [details]
Source of program to show bug.
Comment 2 James Antill 2002-09-04 11:55:57 EDT
Created attachment 74885 [details]
Proposed patch.
Comment 3 Owen Taylor 2002-09-04 12:31:27 EDT
Filed upstream as:

Comment 4 Owen Taylor 2002-10-31 20:34:49 EST
Not going to fix this in advance of upstream.

Note You need to log in before you can comment on or make changes to this bug.