dvipng
[Top][All Lists]
Advanced

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

Re: [Dvipng] dvipng crash in stringrgb function


From: Jan-Åke Larsson
Subject: Re: [Dvipng] dvipng crash in stringrgb function
Date: Thu, 27 Jun 2019 20:38:49 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1

Actually, the test should be

   if (tmp!=NULL) {
Thanks again

/JÅ


On 2019-06-27 22:13, Jan-Åke Larsson wrote:

Thanks, this will be in the next version.

/JÅ

On 2019-06-27 20:25, Ahzo wrote:
Hi,

When dvipng is given an invalid foreground color, it crashes:
$ dvipng -fg
This is dvipng 1.15 Copyright 2002-2015 Jan-Ake Larsson
Segmentation fault (core dumped)

A possible fix is to make sure tmp is not NULL, when trying to access tmp->name:
--- a/color.c
+++ b/color.c
@@ -355,7 +355,7 @@ void stringrgb(const char* color,int *r,int *g,int *b)
         tmp=tmp->next;
       }
     }
-    if (strcmp(color,tmp->name)==0) {
+    if (tmp!=NULL && strcmp(color,tmp->name)==0) {
       /* Found: one-level recursion */
       DEBUG_PRINT(DEBUG_COLOR,("\n    ---RECURSION--- "))
       stringrgb(tmp->color,r,g,b);

Best,
Ahzo

_______________________________________________
Dvipng mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/dvipng
--
Jan-Åke Larsson
Professor, Head of Department


Linköping University
Department of Electrical Engineering
SE-581 83 Linköping
Phone: +46 (0)13-28 14 68
Mobile: +46 (0)13-28 14 68
Visiting address: Campus Valla, House B, Entr 27, 3A:482
Please visit us at www.liu.se

_______________________________________________
Dvipng mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/dvipng
--
Jan-Åke Larsson
Professor, Head of Department


Linköping University
Department of Electrical Engineering
SE-581 83 Linköping
Phone: +46 (0)13-28 14 68
Mobile: +46 (0)13-28 14 68
Visiting address: Campus Valla, House B, Entr 27, 3A:482
Please visit us at www.liu.se

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

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