groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 07/10: [pic]: Fix Savannah #66080 (uninit'd struct mbrs).


From: G. Branden Robinson
Subject: [groff] 07/10: [pic]: Fix Savannah #66080 (uninit'd struct mbrs).
Date: Thu, 17 Oct 2024 20:39:43 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 282e15e0709153337597b613bdc825699da6aace
Author: Lukas Javorsky <ljavorsk@redhat.com>
AuthorDate: Mon Aug 12 15:52:14 2024 +0200

    [pic]: Fix Savannah #66080 (uninit'd struct mbrs).
    
    * src/preproc/pic/object.cpp (object_spec::position_rectangle)
      (object_spec::make_line): Initialize "x" and "y" elements of the
      `here` structure.  Using uninitialized variables in `path::follow()`
      could cause undefined behavior.
    
    Fixes <https://savannah.gnu.org/bugs/?66080>.
---
 ChangeLog                  | 9 +++++++++
 src/preproc/pic/object.cpp | 4 ++++
 2 files changed, 13 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 5d42caf92..bd47d77ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-08-14  Lukas Javorsky <ljavorsk@redhat.com>
+
+       * src/preproc/pic/object.cpp (object_spec::position_rectangle)
+       (object_spec::make_line): Initialize "x" and "y" elements of the
+       `here` structure.  Using uninitialized variables in
+       `path::follow()` could cause undefined behavior.
+
+       Fixes <https://savannah.gnu.org/bugs/?66080>.
+
 2024-10-17  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * doc/pic.ms: Fix omission of `linethick` variable from
diff --git a/src/preproc/pic/object.cpp b/src/preproc/pic/object.cpp
index d0b648c27..b197a02fa 100644
--- a/src/preproc/pic/object.cpp
+++ b/src/preproc/pic/object.cpp
@@ -891,6 +891,8 @@ int object_spec::position_rectangle(rectangle_object *p,
     if (flags & HAS_WITH) {
       place offset;
       place here;
+      here.x = 0;
+      here.y = 0;
       here.obj = p;
       if (!with->follow(here, &offset))
        return 0;
@@ -1512,6 +1514,8 @@ linear_object *object_spec::make_line(position *curpos, 
direction *dirp)
     position pos = at;
     place offset;
     place here;
+    here.x = 0;
+    here.y = 0;
     here.obj = &tmpobj;
     if (!with->follow(here, &offset))
       return 0;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]