freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype-demos][master] * src/ftdump.c (Print_Glyfs): Avo


From: Werner Lemberg (@wl)
Subject: [Git][freetype/freetype-demos][master] * src/ftdump.c (Print_Glyfs): Avoid numeric overflow.
Date: Thu, 14 Dec 2023 06:52:45 +0000

Werner Lemberg pushed to branch master at FreeType / FreeType Demo Programs

Commits:

  • a037baa4
    by Werner Lemberg at 2023-12-14T07:51:56+01:00
    * src/ftdump.c (Print_Glyfs): Avoid numeric overflow.
    
    Reported by Marc Schönefeld <marc.schoenefeld@gmx.org>.
    

1 changed file:

Changes:

  • src/ftdump.c
    ... ... @@ -1332,9 +1332,9 @@
    1332 1332
             continue;
    
    1333 1333
           }
    
    1334 1334
     
    
    1335
    -      if ( loc + 1 >= end )
    
    1335
    +      if ( end == 0 || loc >= end - 1 )
    
    1336 1336
           {
    
    1337
    -        printf( "\nglyph %hd: invalid offset (%d)\n", i, loc );
    
    1337
    +        printf( "\nglyph %hd: invalid offset (%u)\n", i, loc );
    
    1338 1338
             continue;
    
    1339 1339
           }
    
    1340 1340
     
    
    ... ... @@ -1347,7 +1347,7 @@
    1347 1347
     
    
    1348 1348
             if ( loc + 1 >= end )
    
    1349 1349
             {
    
    1350
    -          printf( "\nglyph %hd: invalid offset (%d)\n", i, loc );
    
    1350
    +          printf( "\nglyph %hd: invalid offset (%u)\n", i, loc );
    
    1351 1351
               continue;
    
    1352 1352
             }
    
    1353 1353
     
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]