Accepting request 54333 from home:jdelvare:Factory

OBS-URL: https://build.opensuse.org/request/show/54333
OBS-URL: https://build.opensuse.org/package/show/editors/nedit?expand=0&rev=4
This commit is contained in:
Cristian Rodríguez 2010-12-02 16:56:24 +00:00 committed by Git OBS Bridge
parent 7f465bb044
commit 014fa17db5
5 changed files with 118 additions and 151 deletions

View File

@ -1,6 +1,8 @@
--- nedit-5.4/source/file.c.security 2003-09-28 16:18:12.000000000 +0200
+++ nedit-5.4/source/file.c 2004-03-17 15:25:31.000000000 +0100
@@ -1218,7 +1218,7 @@
Index: nedit-5.5/source/file.c
===================================================================
--- nedit-5.5.orig/source/file.c 2004-08-24 11:37:24.000000000 +0200
+++ nedit-5.5/source/file.c 2010-03-27 18:44:01.000000000 +0100
@@ -1314,7 +1314,7 @@
*/
void PrintString(const char *string, int length, Widget parent, const char *jobName)
{
@ -9,7 +11,7 @@
FILE *fp;
int fd;
@@ -1229,14 +1229,10 @@
@@ -1325,14 +1325,10 @@
1. Create a filename
2. Open the file with the O_CREAT|O_EXCL flags
So all an attacker can do is a DoS on the print function. */
@ -25,8 +27,8 @@
+ if ((fp = fdopen(fd, "w")) == NULL)
{
DialogF(DF_WARN, parent, 1, "Error while Printing",
"Unable to write file for printing:\n%s", "Dismiss",
@@ -1250,7 +1246,7 @@
"Unable to write file for printing:\n%s", "OK",
@@ -1346,7 +1342,7 @@
/* write to the file */
#ifdef IBM_FWRITE_BUG
@ -35,23 +37,23 @@
#else
fwrite(string, sizeof(char), length, fp);
#endif
@@ -1260,6 +1256,7 @@
"%s not printed:\n%s", "Dismiss", jobName, errorString());
@@ -1356,6 +1352,7 @@
"%s not printed:\n%s", "OK", jobName, errorString());
fclose(fp); /* should call close(fd) in turn! */
remove(tmpFileName);
+ free(tmpFileName);
return;
}
@@ -1270,6 +1267,7 @@
"Error closing temp. print file:\n%s", "Dismiss",
@@ -1366,6 +1363,7 @@
"Error closing temp. print file:\n%s", "OK",
errorString());
remove(tmpFileName);
+ free(tmpFileName);
return;
}
@@ -1281,6 +1279,7 @@
@@ -1377,6 +1375,7 @@
PrintFile(parent, tmpFileName, jobName);
remove(tmpFileName);
#endif /*VMS*/

View File

@ -1,141 +1,86 @@
--- nedit-5.5-null-pointers.patch.orig
+++ nedit-5.5-null-pointers.patch
@@ -0,0 +1,108 @@
+--- source/menu.c
++++ source/menu.c 2008/11/01 10:12:04
+@@ -1,4 +1,4 @@
+-static const char CVSID[] = "$Id: menu.c,v 1.115 2004/09/15 22:50:57 n8gray Exp $";
++static const char CVSID[] = "$Id: menu.c,v 1.1 2008/11/01 10:11:21 drahn Exp drahn $";
+ /*******************************************************************************
+ * *
+ * menu.c -- Nirvana Editor menus *
+@@ -1242,7 +1242,7 @@
+ Widget menuItem =
+ createMenuItem( parent, name, label, mnemonic, callback, cbArg, mode );
+
+- XtVaSetValues( menuItem, XmNuserData, topic, 0 );
++ XtVaSetValues( menuItem, XmNuserData, topic, NULL );
+ return menuItem;
+ }
+
+@@ -1254,7 +1254,7 @@
+
+ HidePointerOnKeyedEvent(WidgetToWindow(MENU_WIDGET(menuItem))->lastFocus,
+ ((XmAnyCallbackStruct *)callData)->event);
+- XtVaGetValues( menuItem, XmNuserData, &topic, 0 );
++ XtVaGetValues( menuItem, XmNuserData, &topic, NULL );
+
+ Help(topic);
+ }
+--- source/search.c
++++ source/search.c 2008/11/01 10:13:15
+@@ -1,4 +1,4 @@
+-static const char CVSID[] = "$Id: search.c,v 1.71 2004/08/01 10:06:11 yooden Exp $";
++static const char CVSID[] = "$Id: search.c,v 1.1 2008/11/01 10:12:55 drahn Exp drahn $";
+ /*******************************************************************************
+ * *
+ * search.c -- Nirvana Editor search and replace functions *
+@@ -1042,7 +1042,7 @@
+ XtAddCallback(replaceBtn, XmNactivateCallback, (XtCallbackProc)replaceCB, window);
+ XmStringFree(st1);
+ XtManageChild(replaceBtn);
+- XtVaGetValues(replaceBtn, XmNshadowThickness, &shadowThickness, 0);
++ XtVaGetValues(replaceBtn, XmNshadowThickness, &shadowThickness, NULL);
+ defaultBtnOffset = shadowThickness + 4;
+
+ argcnt = 0;
+--- source/text.c
++++ source/text.c 2008/11/01 10:14:36
+@@ -1,4 +1,4 @@
+-static const char CVSID[] = "$Id: text.c,v 1.48 2004/07/28 18:02:03 n8gray Exp $";
++static const char CVSID[] = "$Id: text.c,v 1.1 2008/11/01 10:13:38 drahn Exp drahn $";
+ /*******************************************************************************
+ * *
+ * text.c - Display text from a text buffer *
+@@ -3126,7 +3126,7 @@
+ cancelDrag(w);
+ if (hasKey("scrollbar", args, nArgs)) {
+ XtVaGetValues(textD->hScrollBar, XmNmaximum, &sliderMax,
+- XmNsliderSize, &sliderSize, 0);
++ XmNsliderSize, &sliderSize, NULL);
+ horizOffset = min(textD->horizOffset + textD->width, sliderMax - sliderSize);
+ if (textD->horizOffset == horizOffset) {
+ ringIfNecessary(silent, w);
+@@ -3218,7 +3218,7 @@
+ if (*nArgs == 0 || sscanf(args[0], "%d", &nPixels) != 1)
+ return;
+ XtVaGetValues(textD->hScrollBar, XmNmaximum, &sliderMax,
+- XmNsliderSize, &sliderSize, 0);
++ XmNsliderSize, &sliderSize, NULL);
+ horizOffset = min(max(0, textD->horizOffset - nPixels), sliderMax - sliderSize);
+ if (textD->horizOffset != horizOffset) {
+ TextDSetScroll(textD, textD->topLineNum, horizOffset);
+@@ -3235,7 +3235,7 @@
+ if (*nArgs == 0 || sscanf(args[0], "%d", &nPixels) != 1)
+ return;
+ XtVaGetValues(textD->hScrollBar, XmNmaximum, &sliderMax,
+- XmNsliderSize, &sliderSize, 0);
++ XmNsliderSize, &sliderSize, NULL);
+ horizOffset = min(max(0, textD->horizOffset + nPixels), sliderMax - sliderSize);
+ if (textD->horizOffset != horizOffset) {
+ TextDSetScroll(textD, textD->topLineNum, horizOffset);
+--- source/window.c
++++ source/window.c 2008/11/01 10:15:20
+@@ -1,4 +1,4 @@
+-static const char CVSID[] = "$Id: window.c,v 1.174 2004/09/15 22:50:58 n8gray Exp $";
++static const char CVSID[] = "$Id: window.c,v 1.1 2008/11/01 10:14:41 drahn Exp drahn $";
+ /*******************************************************************************
+ * *
+ * window.c -- Nirvana Editor window creation/deletion *
+@@ -1157,7 +1157,7 @@
+ if (window->backlightChars)
+ {
+ XtVaSetValues(text, textNbacklightCharTypes,
+- window->backlightCharTypes, 0);
++ window->backlightCharTypes, NULL);
+ }
+ XtManageChild(text);
+ window->textPanes[window->nPanes++] = text;
+@@ -3016,10 +3016,10 @@
+ window->backlightCharTypes = NULL;
+
+ XtVaSetValues(window->textArea,
+- textNbacklightCharTypes, window->backlightCharTypes, 0);
++ textNbacklightCharTypes, window->backlightCharTypes, NULL);
+ for (i=0; i<window->nPanes; i++)
+ XtVaSetValues(window->textPanes[i],
+- textNbacklightCharTypes, window->backlightCharTypes, 0);
++ textNbacklightCharTypes, window->backlightCharTypes, NULL);
+ if (is_applied != do_apply)
+ SetToggleButtonState(window, window->backlightCharsItem, do_apply, False);
+ }
--- nedit.changes.orig
+++ nedit.changes
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Sat Nov 01 10:37:32 CET 2008 - drahn@suse.de
+
+- fix NULL pointers
+
+-------------------------------------------------------------------
Fri Jun 29 14:44:56 CEST 2007 - drahn@suse.de
--- source/text.c 2008/12/24 22:27:27 1.1
+++ source/text.c 2008/12/24 22:28:19
@@ -3126,7 +3126,7 @@
cancelDrag(w);
if (hasKey("scrollbar", args, nArgs)) {
XtVaGetValues(textD->hScrollBar, XmNmaximum, &sliderMax,
- XmNsliderSize, &sliderSize, 0);
+ XmNsliderSize, &sliderSize, NULL);
horizOffset = min(textD->horizOffset + textD->width, sliderMax - sliderSize);
if (textD->horizOffset == horizOffset) {
ringIfNecessary(silent, w);
@@ -3218,7 +3218,7 @@
if (*nArgs == 0 || sscanf(args[0], "%d", &nPixels) != 1)
return;
XtVaGetValues(textD->hScrollBar, XmNmaximum, &sliderMax,
- XmNsliderSize, &sliderSize, 0);
+ XmNsliderSize, &sliderSize, NULL);
horizOffset = min(max(0, textD->horizOffset - nPixels), sliderMax - sliderSize);
if (textD->horizOffset != horizOffset) {
TextDSetScroll(textD, textD->topLineNum, horizOffset);
@@ -3235,7 +3235,7 @@
if (*nArgs == 0 || sscanf(args[0], "%d", &nPixels) != 1)
return;
XtVaGetValues(textD->hScrollBar, XmNmaximum, &sliderMax,
- XmNsliderSize, &sliderSize, 0);
+ XmNsliderSize, &sliderSize, NULL);
horizOffset = min(max(0, textD->horizOffset + nPixels), sliderMax - sliderSize);
if (textD->horizOffset != horizOffset) {
TextDSetScroll(textD, textD->topLineNum, horizOffset);
--- source/search.c 2008/12/24 22:26:53 1.1
+++ source/search.c 2008/12/24 22:27:17
@@ -1042,7 +1042,7 @@
XtAddCallback(replaceBtn, XmNactivateCallback, (XtCallbackProc)replaceCB, window);
XmStringFree(st1);
XtManageChild(replaceBtn);
- XtVaGetValues(replaceBtn, XmNshadowThickness, &shadowThickness, 0);
+ XtVaGetValues(replaceBtn, XmNshadowThickness, &shadowThickness, NULL);
defaultBtnOffset = shadowThickness + 4;
argcnt = 0;
--- source/window.c 2008/12/24 22:28:23 1.1
+++ source/window.c 2008/12/24 22:29:03
@@ -1157,7 +1157,7 @@
if (window->backlightChars)
{
XtVaSetValues(text, textNbacklightCharTypes,
- window->backlightCharTypes, 0);
+ window->backlightCharTypes, NULL);
}
XtManageChild(text);
window->textPanes[window->nPanes++] = text;
@@ -3016,10 +3016,10 @@
window->backlightCharTypes = NULL;
- initial BS version
--- nedit.spec.orig
+++ nedit.spec
@@ -17,6 +17,7 @@ Patch2: nedit-5.4-security.patch
Patch3: nedit-5.5-utf8.patch
Patch4: nedit-5.5-varfix.patch
Patch5: nedit-5.5-nc-manfix.patch
+Patch6: nedit-5.5-null-pointers.patch
%description
NEdit is a GUI style plain text editor for workstations with the X Window System
@@ -31,6 +32,7 @@ and a lot other nice features (and exten
%patch3 -p1
%patch4 -p1
%patch5 -p1
+%patch6 -p0
cp %{S:1} $RPM_BUILD_DIR/%{name}-%{version}/
cp %{S:2} $RPM_BUILD_DIR/%{name}-%{version}/
XtVaSetValues(window->textArea,
- textNbacklightCharTypes, window->backlightCharTypes, 0);
+ textNbacklightCharTypes, window->backlightCharTypes, NULL);
for (i=0; i<window->nPanes; i++)
XtVaSetValues(window->textPanes[i],
- textNbacklightCharTypes, window->backlightCharTypes, 0);
+ textNbacklightCharTypes, window->backlightCharTypes, NULL);
if (is_applied != do_apply)
SetToggleButtonState(window, window->backlightCharsItem, do_apply, False);
}
--- source/menu.c 2008/12/24 22:34:34 1.1
+++ source/menu.c 2008/12/24 22:34:44
@@ -1254,7 +1254,7 @@
HidePointerOnKeyedEvent(WidgetToWindow(MENU_WIDGET(menuItem))->lastFocus,
((XmAnyCallbackStruct *)callData)->event);
- XtVaGetValues( menuItem, XmNuserData, &topic, 0 );
+ XtVaGetValues( menuItem, XmNuserData, &topic, NULL );
Help(topic);
}
--- source/menu.c 2008/12/24 23:16:55 1.1
+++ source/menu.c 2008/12/24 23:17:17
@@ -1242,7 +1242,7 @@
Widget menuItem =
createMenuItem( parent, name, label, mnemonic, callback, cbArg, mode );
- XtVaSetValues( menuItem, XmNuserData, topic, 0 );
+ XtVaSetValues( menuItem, XmNuserData, topic, NULL );
return menuItem;
}

12
nedit-5.5-visfix.patch Normal file
View File

@ -0,0 +1,12 @@
--- nedit-5.5/util/misc.c.visfix 2004-08-10 00:20:00.000000000 +0200
+++ nedit-5.5/util/misc.c 2006-08-30 13:06:31.000000000 +0200
@@ -384,6 +384,9 @@
return (*visual == DefaultVisual(display, screen));
}
+ /* Set "Default" visual to avoid crashes with the detected best ones */
+ reqID = DefaultVisual(display, screen)->visualid;
+
/* Read the visualID and installColormap resources for the application.
visualID can be specified either as a number (the visual id as
shown by xdpyinfo), as a visual class name, or as Best or Default. */

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Sep 17 15:43:01 CEST 2010 - jdelvare@suse.de
- nedit-5.5-visfix.patch: Use default visual, to prevent crashes
when running under compiz. Patch from Mandriva.
-------------------------------------------------------------------
Wed Dec 24 09:50:00 CEST 2008 - drahn@suse.de

View File

@ -18,6 +18,7 @@ Patch3: nedit-5.5-utf8.patch
Patch4: nedit-5.5-varfix.patch
Patch5: nedit-5.5-nc-manfix.patch
Patch6: nedit-5.5-null-pointers.patch
Patch7: nedit-5.5-visfix.patch
%description
NEdit is a GUI style plain text editor for workstations with the X Window System
@ -28,11 +29,12 @@ and a lot other nice features (and extensions for programmers).
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p0
%patch7 -p1
cp %{S:1} $RPM_BUILD_DIR/%{name}-%{version}/
cp %{S:2} $RPM_BUILD_DIR/%{name}-%{version}/