From d16e5bbfdba7a614d2f16348cafaa4a3f03f15ef3e4edb35c8951572038b69f7 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 12 Mar 2007 11:02:26 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/scribus?expand=0&rev=4 --- scribus-1.3.3.7_format-not-literal.patch | 21 +++ ...-1.3.3.7_string-literal-comparsion-b.patch | 157 ++++++++++++++++++ scribus.changes | 10 ++ scribus.spec | 15 +- 4 files changed, 201 insertions(+), 2 deletions(-) create mode 100644 scribus-1.3.3.7_format-not-literal.patch create mode 100644 scribus-1.3.3.7_string-literal-comparsion-b.patch diff --git a/scribus-1.3.3.7_format-not-literal.patch b/scribus-1.3.3.7_format-not-literal.patch new file mode 100644 index 0000000..8492f90 --- /dev/null +++ b/scribus-1.3.3.7_format-not-literal.patch @@ -0,0 +1,21 @@ +--- scribus/plugins/psimport/importps.cpp ++++ scribus/plugins/psimport/importps.cpp +@@ -626,7 +626,7 @@ + filename = filename.mid(0, filename.length()-3) + "psd"; + } + +- qDebug(QString("import %6 image %1: %2x%3 @ (%4,%5) °%5").arg(filename).arg(w).arg(h).arg(x).arg(y).arg(angle).arg(device)); ++ qDebug("%s", QString("import %6 image %1: %2x%3 @ (%4,%5) °%5").arg(filename).arg(w).arg(h).arg(x).arg(y).arg(angle).arg(device)); + QString rawfile = filename.mid(0, filename.length()-3) + "dat"; + QStringList args; + args.append( getShortPathName(PrefsManager::instance()->ghostscriptExecutable()) ); +--- scribus/scimage.cpp ++++ scribus/scimage.cpp +@@ -4416,6 +4416,6 @@ + QMessageBox::warning(ScMW, CommonStrings::trWarning, message, 1, 0, 0); + } + else if (!message.isEmpty()) +- qWarning( message.local8Bit().data() ); ++ qWarning("%s", message.local8Bit().data() ); + return true; + } diff --git a/scribus-1.3.3.7_string-literal-comparsion-b.patch b/scribus-1.3.3.7_string-literal-comparsion-b.patch new file mode 100644 index 0000000..9d3e18f --- /dev/null +++ b/scribus-1.3.3.7_string-literal-comparsion-b.patch @@ -0,0 +1,157 @@ +--- scribus/plugins/scriptplugin/cmdmisc.cpp ++++ scribus/plugins/scriptplugin/cmdmisc.cpp +@@ -190,7 +190,7 @@ + return NULL; + if(!checkHaveDocument()) + return NULL; +- if (Layer == "") ++ if (Layer[0] == 0) + { + PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error")); + return NULL; +@@ -229,7 +229,7 @@ + return NULL; + if(!checkHaveDocument()) + return NULL; +- if (Name == "") ++ if (Name[0] == 0) + { + PyErr_SetString(PyExc_ValueError, QString("Cannot have an empty layer name")); + return NULL; +@@ -261,7 +261,7 @@ + return NULL; + if(!checkHaveDocument()) + return NULL; +- if (Name == "") ++ if (Name[0] == 0) + { + PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error")); + return NULL; +@@ -292,7 +292,7 @@ + return NULL; + if(!checkHaveDocument()) + return NULL; +- if (Name == "") ++ if (Name[0] == 0) + { + PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error")); + return NULL; +@@ -323,7 +323,7 @@ + return NULL; + if(!checkHaveDocument()) + return NULL; +- if (Name == "") ++ if (Name[0] == 0) + { + PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error")); + return NULL; +@@ -355,7 +355,7 @@ + return NULL; + if(!checkHaveDocument()) + return NULL; +- if (Name == "") ++ if (Name[0] == 0) + { + PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error")); + return NULL; +@@ -410,7 +410,7 @@ + return NULL; + if(!checkHaveDocument()) + return NULL; +- if (Name == "") ++ if (Name[0] == 0) + { + PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot create layer without a name.","python error")); + return NULL; +--- scribus/plugins/scriptplugin/cmdobj.cpp ++++ scribus/plugins/scriptplugin/cmdobj.cpp +@@ -30,7 +30,7 @@ + ScMW->doc->toolSettings.dWidth, + ScMW->doc->toolSettings.dBrush, ScMW->doc->toolSettings.dPen, true); + ScMW->doc->setRedrawBounding(ScMW->doc->Items->at(i)); +- if (Name != "") ++ if (Name[0] != 0) + ScMW->doc->Items->at(i)->setItemName(QString::fromUtf8(Name)); + return PyString_FromString(ScMW->doc->Items->at(i)->itemName().utf8()); + } +@@ -59,7 +59,7 @@ + return NULL; + } + ScMW->doc->setRedrawBounding(ScMW->doc->Items->at(i)); +- if (Name != "") ++ if (Name[0] != 0) + ScMW->doc->Items->at(i)->setItemName(QString::fromUtf8(Name)); + return PyString_FromString(ScMW->doc->Items->at(i)->itemName().utf8()); + } +@@ -86,7 +86,7 @@ + return NULL; + } + ScMW->doc->setRedrawBounding(ScMW->doc->Items->at(i)); +- if (Name != "") ++ if (Name[0] != 0) + ScMW->doc->Items->at(i)->setItemName(QString::fromUtf8(Name)); + return PyString_FromString(ScMW->doc->Items->at(i)->itemName().utf8()); + } +@@ -113,7 +113,7 @@ + return NULL; + } + ScMW->doc->setRedrawBounding(ScMW->doc->Items->at(i)); +- if (Name != "") ++ if (Name[0] != 0) + ScMW->doc->Items->at(i)->setItemName(QString::fromUtf8(Name)); + return PyString_FromString(ScMW->doc->Items->at(i)->itemName().utf8()); + } +@@ -151,7 +151,7 @@ + it->updateClip(); + ScMW->doc->setRedrawBounding(it); + it->OwnPage = ScMW->doc->OnPage(it); +- if (Name != "") ++ if (Name[0] != 0) + it->setItemName(QString::fromUtf8(Name)); + return PyString_FromString(it->itemName().utf8()); + } +@@ -224,7 +224,7 @@ + } + ScMW->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false, false); + ScMW->view->AdjustItemSize(it); +- if (Name != "") ++ if (Name[0] != 0) + { + it->setItemName(QString::fromUtf8(Name)); + } +@@ -304,7 +304,7 @@ + } + ScMW->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false, false); + ScMW->view->AdjustItemSize(it); +- if (Name != "") ++ if (Name[0] != 0) + it->setItemName(QString::fromUtf8(Name)); + return PyString_FromString(it->itemName().utf8()); + } +@@ -391,7 +391,7 @@ + } + ScMW->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false, false); + ScMW->view->AdjustItemSize(it); +- if (Name != "") ++ if (Name[0] != 0) + it->setItemName(QString::fromUtf8(Name)); + return PyString_FromString(it->itemName().utf8()); + } +@@ -429,7 +429,7 @@ + PageItem *it = ScMW->doc->Items->at(i); + ScMW->view->ToPathText(); + ScMW->view->MoveItem(pageUnitXToDocX(x) - it->xPos(), pageUnitYToDocY(y) - it->yPos(), it); +- if (Name != "") ++ if (Name[0] != 0) + it->setItemName(QString::fromUtf8(Name)); + return PyString_FromString(it->itemName().utf8()); + } +@@ -532,7 +532,7 @@ + return NULL; + } + // for current item only +- if (ScMW->doc->m_Selection->count() == 0 || name != "") ++ if (ScMW->doc->m_Selection->count() == 0 || name[0] != 0) + { + // quick hack to always apply on the right frame - pv + ScMW->view->Deselect(true); diff --git a/scribus.changes b/scribus.changes index fa7af18..9258adb 100644 --- a/scribus.changes +++ b/scribus.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Mar 12 09:54:04 CET 2007 - pgajdos@suse.cz + +- fixed gcc warnings in beta version: + * program uses possibly exploitable format strings + (format-not-literal.patch) + * program compares a char* pointer with string literal + (string-literal-comparsion.patch) + * added CFLAG -fno-strict-aliasing inside scribus.spec + ------------------------------------------------------------------- Thu Mar 8 15:02:42 CET 2007 - pgajdos@suse.cz diff --git a/scribus.spec b/scribus.spec index 845ad58..fc5a718 100644 --- a/scribus.spec +++ b/scribus.spec @@ -28,9 +28,11 @@ Suggests: AdobeICCProfiles Provides: scribus-short-words Obsoletes: scribus-i18n-de scribus-i18n-en scribus-i18n-fr scribus-short-words Version: 1.3.3.7 -Release: 7 +Release: 9 Source: %{name}-%{version}.tar.bz2 Patch: %{name}-%{version}_string-literal-comparsion.patch +Patch1: %{name}-%{version}_format-not-literal.patch +Patch2: %{name}-%{version}_string-literal-comparsion-b.patch URL: http://www.scribus.net/ BuildRoot: %{_tmppath}/%{name}-%{version}-build Summary: Open Source Page Layout and Desktop Publishing (DTP) @@ -102,13 +104,15 @@ Authors: %prep %setup -q %patch +%patch1 +%patch2 %build . /etc/opt/kde3/common_options update_admin --no-unsermake #autoconf export CFLAGS="$RPM_OPT_FLAGS" -export CXXFLAGS="$RPM_OPT_FLAGS" +export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" ./configure \ --prefix=%{prefix} \ --libdir=%{_libdir} \ @@ -171,6 +175,13 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/include/scribus %changelog +* Mon Mar 12 2007 - pgajdos@suse.cz +- fixed gcc warnings in beta version: + * program uses possibly exploitable format strings + (format-not-literal.patch) + * program compares a char* pointer with string literal + (string-literal-comparsion.patch) + * added CFLAG -fno-strict-aliasing inside scribus.spec * Thu Mar 08 2007 - pgajdos@suse.cz - fixed 'warning: comparsion with string literal' (#233016, #228963) - string-literal-comparsion.patch