patchgrep - Patches: patch #3840, fix for off by one error in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #3840: fix for off by one error in src/grep.c:prpending()

Submitter:  Claudio Fontana <sick_soul>
Submitted:  Sun 20 Mar 2005 06:58:46 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Mon 13 Jun 2005 07:55:55 PM UTC, comment #2: 

This patch fixed the following seg-faults as reported by Pavol Gono when using --max-count and --after-context:

> $ cat bla1
> 4
> 40
> $ cat bla2
> 4
> 04
> $ cat bla3
> 4
> 444
> $ egrep -m1 -A99 "^4$" bla1
> 4
> Segmentation fault
> $ egrep -m1 -A99 "^4$" bla2
> 4
> Segmentation fault
> $ egrep -m1 -A99 "^4$" bla3
> 4
> Segmentation fault
> $ egrep -m1 -A99 "^4" bla1
> 4
> $ egrep -m1 -A99 "^4" bla2
> 4
> Segmentation fault
> $ egrep -m1 -A99 "^4" bla3
> 4
> $ egrep -m1 -A99 "4$" bla1
> 4
> Segmentation fault
> $ egrep -m1 -A99 "4$" bla2
> 4
> $ egrep -m1 -A99 "4$" bla3
> 4


There are now regression tests for this in tests/foad1.sh.

Julian Foad <julianfoad>
Tue 12 Apr 2005 06:51:36 PM UTC, comment #1: 

Fixed in CVS.

Julian Foad <julianfoad>
Sun 20 Mar 2005 06:58:46 PM UTC, original submission:  

This patch fixes an off by one error in prpending(), which was
cutting the end of line sentinel.

This problem manifests with segfaults/wrong output when prpending() deals with input that reaches the end of file.


Claudio Fontana <sick_soul>

 

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

Attached Files
file #8593:  fix_prpending.patch added by sick_soul (476B - text/x-patch - fix for off by one error in src/grep.c:prpending())

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

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.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-04-12 julianfoad StatusNone Done
    Open/ClosedOpen Closed
2005-03-20 sick_soul Attached File- Added fix_prpending.patch, #4369
    Carbon-Copy- Added -email is unavailable-

Back to the top

Powered by Savane 3.13-4448.
Corresponding source code