bugGNU roff - Bugs: bug #58337, negative arguments to .ss request...

 
 

bug #58337: negative arguments to .ss request cause assertion failure

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Fri 08 May 2020 10:44:27 PM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Crash/Unresponsive Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 01 Mar 2022 02:08:55 PM UTC, comment #2: 


commit c3047d8f5881e21cf4f09c13d88106c71aa25004
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sat May 9 10:55:06 2020 +1000

    Fix assertion failure on negative space size.

    * src/roff/troff/env.cpp (space_size): If an argument to the .ss request
      is negative, throw a range warning and ignore it.

    * src/roff/groff/tests/regression_savannah_58337.sh: Add test.

    * src/roff/groff/groff.am: Run test.

    Fixes https://savannah.gnu.org/bugs/index.php?58337.


G. Branden Robinson <gbranden>
Group administrator
Sat 09 May 2020 01:09:34 AM UTC, comment #1: 

Fixed in c3047d8f5881e21cf4f09c13d88106c71aa25004.

G. Branden Robinson <gbranden>
Group administrator
Fri 08 May 2020 10:44:27 PM UTC, original submission:  

I didn't think my C99-conformant assert() rewrite would pay off this quickly.


$ ./build/test-groff -Tutf8
.ss 12 -1
a
troff: ../src/roff/troff/number.cpp:653: scale(): assertion failed: 'x >= 0 && y > 0'
[...]/build/groff: error: troff: Signal 6 (core dumped)


Same happens if the arguments to .ss are swapped.

Seems like we should just reject negative values for these parameters.

Zeroes are fine.  They result in ugly typography (for conventional applications), but they don't crash groff.

G. Branden Robinson <gbranden>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-05-09 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code