Bug 216571 - audacious creates bad CDDB query strings
audacious creates bad CDDB query strings
Product: Fedora
Classification: Fedora
Component: audacious (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ralf Ertzinger
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2006-11-21 00:23 EST by Richard Chan
Modified: 2008-08-02 19:40 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-02-18 12:18:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Richard Chan 2006-11-21 00:23:17 EST
Description of problem:

Audacious creates bad CDDB query strings to the server due to an interaction
between sprintf and FORTIFY_SOURCE in gcc/glibc.

CDDB query command string includes an offsets string that looks like
150+22924+36379+186648 (depending on the number of tracks)

Audacious is truncating this to +186648 (i.e. only the last offset)

This due to the use of the construct
...sprintf(buffer, "%s+%d", buffer, ....) in Plugins/Input/cdaudio/cddb.c
and gcc -D_FORTIFY_SOURCE=2. In-place reuse of buffer doesn't work in
this case., i.e. suppose buffer is "150" and the intention is to
extend it to "150+22924" - with the use of FORTIFY_SOURCE it becomes
"+22924" only.

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

How reproducible:

Steps to Reproduce:
1.Insert CD-Audio
2.Enable CDDB lookup
3. Enable Network Window
Actual results:
Server will reply with 500: Invalid command syntax

Expected results:
Server will reply with CD information

Additional info:
Comment 1 Richard Chan 2006-11-21 03:02:35 EST
I've learnt from the gcc maintainer that it is undefined behaviour for sprintf to 
reuse the same buffer. This is a bug in upstream. 
Comment 2 Ralf Ertzinger 2006-11-21 04:26:29 EST
The bug is still valid, since audacious does produce invalid strings.
I'll incorporate your patch in the upcoming 1.2.x release.
Comment 3 Richard Chan 2006-11-21 20:58:37 EST
The reference for the gcc bug is 215690 where the maintainer explains
the undefined use of sprintf.
Comment 4 Ralf Ertzinger 2006-12-04 06:15:09 EST
This should be fixed in 1.2.2, released for FC-6

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