- lefty PTY functionality relies on file descriptor implementation details #1823
- buffer overflow in fdpgen
- Crashes by VRML output when current directory is not writable #793
+- Segmentation fault when newrank=true #1221
## [2.44.1] - 2020-06-29
*/
#include <assert.h>
+#include <cgraph/cgraph.h>
#include <dotgen/dot.h>
#include <limits.h>
#include <stdlib.h>
+#include <string.h>
/* #define DEBUG */
#define MARK(v) (ND_mark(v))
int c, nc;
char *s;
+ /* check whether malformed input has led to empty cluster that the crossing
+ * functions will not anticipate
+ */
+ {
+ size_t i;
+ for (i = 1; i <= (size_t)GD_n_cluster(g); ) {
+ if (agfstnode(GD_clust(g)[i]) == NULL) {
+ agwarningf("removing empty cluster\n");
+ memmove(&GD_clust(g)[i], &GD_clust(g)[i + 1],
+ ((size_t)GD_n_cluster(g) - i) * sizeof(GD_clust(g)[0]));
+ --GD_n_cluster(g);
+ } else {
+ ++i;
+ }
+ }
+ }
+
init_mincross(g);
for (nc = c = 0; c < GD_comp(g).size; c++) {
--- /dev/null
+digraph "Graph d718cbc6-5e20-4417-a41a-e1e380469dd2" {
+ graph [
+ newrank=true
+ ];
+ subgraph "cluster_1" {
+ 1;
+ }
+ subgraph "cluster_2" {
+ 1
+ }
+}
+
# Graphviz should not have caused a segfault
assert p.returncode != -signal.SIGSEGV, 'Graphviz segfaulted'
+def test_1221():
+ '''
+ assigning a node to two clusters with newrank should not cause a crash
+ https://gitlab.com/graphviz/graphviz/-/issues/1221
+ '''
+
+ # locate our associated test case in this directory
+ input = os.path.join(os.path.dirname(__file__), '1221.dot')
+ assert os.path.exists(input), 'unexpectedly missing test case'
+
+ # process this with dot
+ subprocess.check_call(['dot', '-Tsvg', '-o', os.devnull, input])
+
def test_1314():
'''
test that a large font size that produces an overflow in Pango is rejected