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

View File

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