]> granicus.if.org Git - graphviz/commit
fix integer overflow in ordering function
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 19 Jun 2022 21:38:37 +0000 (14:38 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 25 Jun 2022 03:04:35 +0000 (20:04 -0700)
commitcccb8b1d22a18031fc92d93133c7fa14ef7e1361
tree3f54eb6140f0cbc736a24b1e40a69b1cd22a6f12
parent830202c86236cf6e6f2b53f376ca3c33a93d7f6b
fix integer overflow in ordering function

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
lib/label/xlabels.c