[PATCH libXfont] Fix buffer read overrun

walter harms wharms at bfs.de
Mon Apr 7 13:25:36 PDT 2014



Am 07.04.2014 20:29, schrieb Peter Harris:
> "FreeType" is only eight bytes long. The atom "FreeType\x00\x??" is
> probably not what the author intended.
> 
> Signed-off-by: Peter Harris <pharris at opentext.com>
> ---
>  src/FreeType/ftfuncs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/FreeType/ftfuncs.c b/src/FreeType/ftfuncs.c
> index 65efefc..a4969d1 100644
> --- a/src/FreeType/ftfuncs.c
> +++ b/src/FreeType/ftfuncs.c
> @@ -1867,7 +1867,7 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
>      i++;
>  
>      info->props[i].name  = MakeAtom("RASTERIZER_NAME", 15, TRUE);
> -    info->props[i].value = MakeAtom("FreeType", 10, TRUE);
> +    info->props[i].value = MakeAtom("FreeType", 8, TRUE);
>      info->isStringProp[i] = 1;
>      i++;
>  

Since i am not a big fan of magic numbers ...
MakeAtom("FreeType", strlen("FreeType"), TRUE);

maybe there is macro for that ?

re,
 wh




More information about the xorg-devel mailing list