]> granicus.if.org Git - graphviz/commitdiff
fix corruption of user shape characteristics during EPSF initialization
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 6 Mar 2022 22:28:23 +0000 (14:28 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 12 Mar 2022 21:04:53 +0000 (13:04 -0800)
From the surrounding context, it is clear this code was intending to set `h`,
the height of the shape, not overwrite the `y` coordinate it had previously set
for the shape. This change not only fixes the overwrite of `us->y` but fixes a
read of uninitialized memory in `us->h` by the caller of this function.

It is not clear to me what the full user-visible effect of this change is.

CHANGELOG.md
lib/common/psusershape.c

index 5484c1d024350b9dfa9263f0d0a3a966173e863c..77d7897ca54864eec2d8e1b0caa145ab76b862b3 100644 (file)
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
   regression in Graphviz 2.46.0. Other cases have existed since the first
   release of `gvpr`. #2185
 - spurious "no hard-coded metrics" warnings on labels with empty lines #2179
+- fixed corruption of user shape characteristics during EPSF initialization
 
 ## [3.0.0] – 2022-02-26
 
index a6ce33e983e99ae0589fe0bae2c14d2949614b12..a401e02f49e2ba3de98fc489e98b1051c9a2a04c 100644 (file)
@@ -74,7 +74,7 @@ static usershape_t *user_init(const char *str)
        us->x = lx;
        us->y = ly;
        us->w = ux - lx;
-       us->y = uy - ly;
+       us->h = uy - ly;
        us->name = str;
        us->macro_id = N_EPSF_files++;
        fstat(fileno(fp), &statbuf);