[Poppler-bugs] [Bug 37745] New: Problems in file goo/GooString.cc

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon May 30 05:52:14 PDT 2011


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

           Summary: Problems in file goo/GooString.cc
           Product: poppler
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
        AssignedTo: poppler-bugs at lists.freedesktop.org
        ReportedBy: fusionefredda at yahoo.it


I'm using poppler 0.16.5.
In one pdf with weird goto link entries (for example, in vi editor I see an
entry "þÿ") the bsearch (row 677 of file poppler/Catalog.cc) for some value
does not work correctly. I founded that the reason is a not totally correct
implementation of methods "int GooString::cmp(GooString *str) const", "int
GooString::cmpN(GooString *str, int n) const", "int GooString::cmp(const char
*sA) const", and "int GooString::cmpN(const char *sA, int n) const".
In each of these methods, the row "x = *p1 - *p2;" should be replaced with: 
"x = (unsigned char)*p1 - (unsigned char)*p2;"

The rows of file goo/GooString.cc that needs this replace are:
694, 711, 728, 748.

I founded that is fine too the use of strcmp and strncmp c library functions.
E.g., "int GooString::cmp(GooString *str) const" could be simply implemented
like this:

int GooString::cmp(GooString *str) const {
    return strcmp(s, str->s);
}

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list