[vlc-devel] [PATCH] text_style: fix overflow in vlc_html_color

Rémi Denis-Courmont remi at remlab.net
Wed Jul 4 08:49:34 CEST 2018


FWIW, strtoul() can exceed 32bits.

Also nit in description.

Le 4 juillet 2018 01:54:59 GMT+03:00, Salah-Eddin Shaban <salah at videolan.org> a écrit :
>This was heppening on Windows for colors like #ff0000ff
>
>fixes #19974
>---
> src/misc/text_style.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/src/misc/text_style.c b/src/misc/text_style.c
>index 43944afb5a..52ef89a62a 100644
>--- a/src/misc/text_style.c
>+++ b/src/misc/text_style.c
>@@ -312,7 +312,7 @@ unsigned int vlc_html_color( const char *psz_value,
>bool* ok )
>         (*psz_hex >= '0' && *psz_hex <= '9') ||
>         (*psz_hex >= 'A' && *psz_hex <= 'F') )
>     {
>-        uint32_t i_value = strtol( psz_hex, &psz_end, 16 );
>+        uint32_t i_value = strtoul( psz_hex, &psz_end, 16 );
>         if( *psz_end == 0 || isspace( *psz_end ) )
>         {
>             switch( psz_end - psz_hex )
>-- 
>2.13.7
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20180704/f5eb778f/attachment.html>


More information about the vlc-devel mailing list