The test case for #1906 triggers an overflow in this function, viewable with
UBSan:
$ dot -Kirco -Tgv -o /dev/null tests/graphs/root.gv
/builds/graphviz/graphviz/lib/label/xlabels.c:35:15: runtime error: signed
integer overflow: -
1884993080 -
1219985688 cannot be represented in type
'int'
Gitlab: #1906
(void)dt;
(void)disc;
int k1 = *((int *) v1), k2 = *((int *) v2);
- return k1 - k2;
+ if (k1 < k2) {
+ return -1;
+ }
+ if (k1 > k2) {
+ return 1;
+ }
+ return 0;
}
static XLabels_t *xlnew(object_t * objs, int n_objs, xlabel_t * lbls,