emacs-31 7621ee1d012 2/2: Fix uninit read in Android TrueType font scan

Paul Eggert <[email protected]> Tue, 7 Jul 2026 16:37:42 -0400 (EDT)
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: emacs-31
commit 7621ee1d01229d50e5c0cddea6bf0b01095a62cf
Author: Paul Eggert <[email protected]>
Commit: Paul Eggert <[email protected]>

    Fix uninit read in Android TrueType font scan
    
    Problem reported privately by Michal Majchrowicz and Marcin
    Wyczechowski, members of the AFINE Team.
    * src/sfnt.c (sfnt_read_table_directory):
    Fix typo where wrong size was used.
---
 src/sfnt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sfnt.c b/src/sfnt.c
index 559825d1804..8b8b2ae411d 100644
--- a/src/sfnt.c
+++ b/src/sfnt.c
@@ -263,7 +263,7 @@ sfnt_read_table_directory (int fd)
 
   rc = read (fd, subtable->subtables, subtable_size);
 
-  if (rc == -1 || rc < offset)
+  if (rc == -1 || rc < subtable_size)
     {
       xfree (subtable);
       return NULL;