mirror of
				https://github.com/SwallowOS/xorg_lib_libxfont
				synced 2025-11-04 05:45:47 +08:00 
			
		
		
		
	bitmap: Bail out on invalid input to FontFileMakeDir instead of calling calloc for 0 bytes
Found by clang static analysis:
    Call to 'calloc' has an allocation size of 0 bytes
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
			
			
This commit is contained in:
		@@ -1477,6 +1477,10 @@ BitmapScaleBitmaps(FontPtr pf,          /* scaled font */
 | 
			
		||||
    lastRow = pfi->lastRow;
 | 
			
		||||
 | 
			
		||||
    nchars = (lastRow - firstRow + 1) * (lastCol - firstCol + 1);
 | 
			
		||||
    if (nchars <= 0) {
 | 
			
		||||
        goto bail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    glyph = pf->glyph;
 | 
			
		||||
    for (i = 0; i < nchars; i++)
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user