]> granicus.if.org Git - graphviz/commit
fix: uniformly treat margin as unsigned in pack.c
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 17 May 2020 23:23:26 +0000 (16:23 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 6 Jun 2020 00:36:22 +0000 (17:36 -0700)
commit9e7d3b1d41c917327f8507fb53b161a023f013de
tree23134865c31ff09eb731960c72bd5aa4de4e8d38
parent9e3c198058371092262eafe37b1a3476b1804db6
fix: uniformly treat margin as unsigned in pack.c

Although margin is an unsigned int in pack_info, it was being passed around as a
signed int within pack.c. UBSan identified seven undefined overflows that
happened as a result of this with the following input:

  digraph G {rLn pack=-11335142740g}er-

Fixes #1681. Several of these were also pointed to by -Wsign-conversion compiler
warnings.
lib/pack/pack.c