- b15.gv crashes dot #827
- heap overflow in function startElementHandler in gxl2gv.c #2093
- Crash on assertion #121
+- `xdotversion` attribute is no longer misparsed. This was a regression in
+ Graphviz 2.47.2. #358
## [4.0.0] – 2022-05-29
#include <io.h>
#endif
-#include <limits.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
}
static unsigned short
-versionStr2Version (const char* str)
+versionStr2Version (char* str)
{
- unsigned long u = strtoul(str, NULL, 10);
- if (u == 0 || u > USHRT_MAX) {
- agerr(AGWARN, "xdot version \"%s\" too long", str);
- }
+ char c, buf[BUFSIZ];
+ int n = 0;
+ char* s = str;
+ unsigned short us;
- return (unsigned short)u;
+ while ((c = *s++)) {
+ if (isdigit(c)) {
+ if (n < BUFSIZ-1) buf[n++] = c;
+ else {
+ agerr(AGWARN, "xdot version \"%s\" too long", str);
+ break;
+ }
+ }
+ }
+ buf[n] = '\0';
+
+ us = atoi(buf);
+ return us;
}
/*
assert p.returncode != 0, "syntax error was only a warning, not an error"
-@pytest.mark.xfail(strict=True)
def test_358():
"""
setting xdot version to 1.7 should enable font characteristics