Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 251675 - sys-apps/dog-1.7-r2 - Segmentation Fault when running dog --strfry on a file with blank lines
Summary: sys-apps/dog-1.7-r2 - Segmentation Fault when running dog --strfry on a file ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Shell Tools project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-19 21:13 UTC by bob5972
Modified: 2009-04-10 04:35 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bob5972 2008-12-19 21:13:06 UTC
sys-apps/dog-1.7-r2: Segmentation Fault if running dog --strfry on a file with blank lines (for instance dog.c)

Reproducible: Always

Steps to Reproduce:
1. Emerge dog
2. Extract the dog-1.7.tar.gz file somewhere
3. dog --strfry dog.c

Actual Results:  
It prints the strfry'd version of the file up until the first blank line, and then has a Segmentation Fault.

Expected Results:  
It should have printed a blank line, and then continued on to the rest of the file.

The problem seems to be that the GNU strfry function doesn't like zero length strings, so checking for that by applying the following patch seems to fix it.
The upstream project website and emails don't seem to work anymore.

--- dog.c.orig	2008-12-19 13:00:47.000000000 -0800
+++ dog.c	2008-12-19 13:01:14.000000000 -0800
@@ -560,7 +560,7 @@
 	
 	// strfry()
 #if ALLOW_STRFRY
-	if (opt_strfry) {
+	if (opt_strfry && str_len > 0) {
 		strfry(str);
 	}
 #endif
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2008-12-19 21:16:44 UTC
Reassigning to shell-tools herd.
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-04-10 04:35:01 UTC
committed to -r3 thx. please file a stablereq bug in 30 days. I will forget.