bugThe FreeType Project - Bugs: bug #50548, src/sfnt/sfdriver.c:970:12:...

 
 

bug #50548: src/sfnt/sfdriver.c:970:12: warning: ‘p’ may be used uninitialized in this function

Submitted by:  None
Submitted on:  Wed 15 Mar 2017 07:57:47 AM UTC  
 
Severity: 3 - NormalItem Group: None
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.8

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 15 Mar 2017 10:36:22 AM UTC, comment #2:

Fixed, together with some other warnings. Thanks for the report.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Wed 15 Mar 2017 08:06:41 AM UTC, comment #1:

Two other issues pointed out by clang --analyze:

In file included from /home/markus/freetype2/src/cff/cff.c:25:
/home/markus/freetype2/src/cff/cffparse.c:897:5: warning: Value stored to 'error' is never read
error = FT_ERR( Stack_Underflow );
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

In file included from /home/markus/freetype2/src/autofit/autofit.c:43:
/home/markus/freetype2/src/autofit/afwarp.c:94:15: warning: Value stored to 'xx1max' during its initialization is never read
FT_Pos xx1max = warper->x1max;
^~~~~~ ~~~~~~~~~~~~~
1 warning generated.

Anonymous
Wed 15 Mar 2017 07:57:47 AM UTC, original submission:

Both gcc and clang warn:

In file included from /home/markus/freetype2/src/sfnt/sfnt.c:28:0:
/home/markus/freetype2/src/sfnt/sfdriver.c: In function ‘sfnt_get_ps_name’:
/home/markus/freetype2/src/sfnt/sfdriver.c:970:12: warning: ‘p’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if ( p - result > MAX_PS_NAME_LEN )
~~^~~~~~~~
/home/markus/freetype2/src/sfnt/sfdriver.c:779:12: note: ‘p’ was declared here
char* p;
^

=====

/home/markus/freetype2/src/sfnt/sfdriver.c:875:12: warning: variable 'p' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if ( ps_name )
^~~~~~~
/home/markus/freetype2/src/sfnt/sfdriver.c:970:10: note: uninitialized use occurs here
if ( p - result > MAX_PS_NAME_LEN )
^
/home/markus/freetype2/src/sfnt/sfdriver.c:875:7: note: remove the 'if' if its condition is always false
if ( ps_name )
^~~~~~~~~~~~~~
/home/markus/freetype2/src/sfnt/sfdriver.c:779:13: note: initialize the variable 'p' to silence this warning
char* p;
^
= NULL

Also clang --analyze shows:

In file included from /home/markus/freetype2/src/sfnt/sfnt.c:25:
/home/markus/freetype2/src/sfnt/ttcmap.c:2350:11: warning: Value stored to 'gindex' is never read
gindex = 0;
^ ~
1 warning generated.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wl (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 15 Mar 2017 10:36:22 AM UTCwlStatusNone=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.8

    Back to the top


    Powered by Savane 3.1-cleanup1