[Bug 752428] New: dashdemux: replace sscanf with strtoul

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Jul 15 08:58:13 PDT 2015


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

            Bug ID: 752428
           Summary: dashdemux: replace sscanf with strtoul
    Classification: Platform
           Product: GStreamer
           Version: git master
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: gst-plugins-bad
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: florin.apostol at oregan.net
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

gstmpdparser.c file uses sscanf(..., "%u", ...) to read numbers from the xml
file. sscanf is unable to indicate the fact that the input string was
completely parsed or not. For example, for the input "123xyz" the sscanf
function will return 1 (it successfully read an integer).

A better function is strtol (and strtoul, etc). This has the ability to provide
a pointer to the next unparsed character in string. Using this, we can detect
if the original string was valid or not.

The question is how restrictive the parser should be? Where a number is
expected in an xml attribute and a "123xyz" is provided, should the parser read
and use 123 or it should signal an error? Currently it reads just 123 and no
error or warnings are issued (provided it does not need to parse the attribute
further than the number).

So, should we make the parser more restrictive or not?

-- 
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 gstreamer-bugs mailing list