From: | "Pacho Ramos (pacho)" <pacho@g.o> |
---|---|
To: | gentoo-commits@l.g.o |
Subject: | [gentoo-commits] gentoo-x86 commit in x11-libs/gtk+extra/files: gtk+extra-2.1.2-itementry-crash.patch |
Date: | Wed, 02 Feb 2011 19:00:28 |
Message-Id: | 20110202190019.89D7A20054@flycatcher.gentoo.org |
1 | pacho 11/02/02 19:00:19 |
2 | |
3 | Added: gtk+extra-2.1.2-itementry-crash.patch |
4 | Log: |
5 | Fix crashes with dev-embedded/gpsim (bug #353489 by Robert Pearce). |
6 | |
7 | (Portage version: 2.1.9.35/cvs/Linux x86_64) |
8 | |
9 | Revision Changes Path |
10 | 1.1 x11-libs/gtk+extra/files/gtk+extra-2.1.2-itementry-crash.patch |
11 | |
12 | file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/gtk+extra/files/gtk+extra-2.1.2-itementry-crash.patch?rev=1.1&view=markup |
13 | plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/gtk+extra/files/gtk+extra-2.1.2-itementry-crash.patch?rev=1.1&content-type=text/plain |
14 | |
15 | Index: gtk+extra-2.1.2-itementry-crash.patch |
16 | =================================================================== |
17 | --- gtkextra/gtkitementry.c 2011-02-02 13:36:17.402632207 +1100 |
18 | +++ gtkextra/gtkitementry.c 2011-02-02 17:20:26.305418034 +1100 |
19 | @@ -778,11 +778,12 @@ |
20 | memcpy (entry->text + index, new_text, new_text_length); |
21 | #endif //GTK_TYPE_ENTRY_BUFFER |
22 | |
23 | - ientry->item_n_bytes += new_text_length; |
24 | - entry->text_length += n_chars; |
25 | + if (new_text_length + *position > ientry->item_n_bytes) |
26 | + ientry->item_n_bytes = new_text_length + *position; |
27 | |
28 | /* NUL terminate for safety and convenience */ |
29 | entry->text[ientry->item_n_bytes] = '\0'; |
30 | + entry->text_length = strlen(entry->text); |
31 | |
32 | if (entry->current_pos > *position) |
33 | entry->current_pos += n_chars; |