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
|
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
|
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
|
|