Bug 431150

Summary: [PATCH] Fix a crash when deleting and adding rows
Product: [Fedora] Fedora Reporter: Miloslav Trmač <mitr>
Component: gtk+extraAssignee: Alain Portal <alain.portal>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: medium    
Version: 8   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.1.1-6.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-17 03:54:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
Make sure sheet->maxallocrow does not point to deallocated rows none

Description Miloslav Trmač 2008-02-01 01:26:21 UTC
Version-Release number of selected component (if applicable):
gtk+extra-2.1.1-6

Steps to Reproduce:
Kind of difficult.  Basically, delete rows from the end of a GtkSheet, then
re-add them.

When a GtkSheet is initialized, sheet->maxrow == 0 && sheet->maxallocrow == 1. 
After adding some rows, sheet->maxrow == N && sheet->maxallocrow == N+1.

Then, deleting M rows from the end will clear data for all rows from (N-M+1) on,
and eventually sheet->maxrow is set to (N-M), but sheet->maxallocrow is,
incorrectly, decremented only to (N-M+1).

Later, when more rows are added to the end using gtk_sheet_insert_row(), data
for the row (N-M+1) is not allocated again, and InsertRow() crashes in the loop
that attempts to update cell->row when dereferencing a NULL pointer.

Comment 1 Miloslav Trmač 2008-02-01 01:26:21 UTC
Created attachment 293676 [details]
Make sure sheet->maxallocrow does not point to deallocated rows

Comment 2 Fedora Update System 2008-04-07 09:32:38 UTC
gtk+extra-2.1.1-6.fc7 has been submitted as an update for Fedora 7

Comment 3 Fedora Update System 2008-04-07 09:37:42 UTC
gtk+extra-2.1.1-7.fc8 has been submitted as an update for Fedora 8

Comment 4 Alain Portal 2008-04-07 09:42:08 UTC
Sorry for a so late answer.
Thanks for the patch, I just commited it on F7, F8 and devel.

Here as the links to tell if the updates work for you
https://admin.fedoraproject.org/updates/F7/pending/gtk+extra-2.1.1-6.fc7
https://admin.fedoraproject.org/updates/F8/pending/gtk+extra-2.1.1-7.fc8

Comment 5 Fedora Update System 2008-04-09 05:15:00 UTC
gtk+extra-2.1.1-6.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update gtk+extra'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F7/FEDORA-2008-2923

Comment 6 Fedora Update System 2008-04-17 03:54:38 UTC
gtk+extra-2.1.1-6.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2008-04-17 03:56:19 UTC
gtk+extra-2.1.1-7.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.