summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Năstac <mrness@gentoo.org>2007-09-06 10:03:35 +0000
committerAlin Năstac <mrness@gentoo.org>2007-09-06 10:03:35 +0000
commit634704371d356895218bae3e93f78394df5329b7 (patch)
treeb5924d86b65f6ae8f859a3dcb8a921b17e21b55d /app-mobilephone
parentversion bump (diff)
downloadgentoo-2-634704371d356895218bae3e93f78394df5329b7.tar.gz
gentoo-2-634704371d356895218bae3e93f78394df5329b7.tar.bz2
gentoo-2-634704371d356895218bae3e93f78394df5329b7.zip
Version bump; fix several buffer overflows (#191191).
(Portage version: 2.1.2.12)
Diffstat (limited to 'app-mobilephone')
-rw-r--r--app-mobilephone/gammu/ChangeLog8
-rw-r--r--app-mobilephone/gammu/files/digest-gammu-1.13.03
-rw-r--r--app-mobilephone/gammu/files/gammu-1.13.0-fixups.patch113
-rw-r--r--app-mobilephone/gammu/gammu-1.13.0.ebuild81
4 files changed, 204 insertions, 1 deletions
diff --git a/app-mobilephone/gammu/ChangeLog b/app-mobilephone/gammu/ChangeLog
index 6b0ab92d8485..80900cd5a643 100644
--- a/app-mobilephone/gammu/ChangeLog
+++ b/app-mobilephone/gammu/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-mobilephone/gammu
# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-mobilephone/gammu/ChangeLog,v 1.44 2007/08/22 07:05:27 opfer Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-mobilephone/gammu/ChangeLog,v 1.45 2007/09/06 10:03:35 mrness Exp $
+
+*gammu-1.13.0 (06 Sep 2007)
+
+ 06 Sep 2007; Alin Năstac <mrness@gentoo.org>
+ +files/gammu-1.13.0-fixups.patch, +gammu-1.13.0.ebuild:
+ Version bump; fix several buffer overflows (#191191).
22 Aug 2007; Christian Faulhammer <opfer@gentoo.org> gammu-1.12.0.ebuild:
stable x86, bug 139308
diff --git a/app-mobilephone/gammu/files/digest-gammu-1.13.0 b/app-mobilephone/gammu/files/digest-gammu-1.13.0
new file mode 100644
index 000000000000..95e327ec3d87
--- /dev/null
+++ b/app-mobilephone/gammu/files/digest-gammu-1.13.0
@@ -0,0 +1,3 @@
+MD5 f2a9af55ece850cf5917f1365abd186b gammu-1.13.0.tar.bz2 964504
+RMD160 6f9ae52adf89cf5e7d16f9b0531017cd0a5f77d2 gammu-1.13.0.tar.bz2 964504
+SHA256 543cd847431d85cbbbd96c7914a2dd4d9fdcf74419dbe5693b93d8dc94ba945a gammu-1.13.0.tar.bz2 964504
diff --git a/app-mobilephone/gammu/files/gammu-1.13.0-fixups.patch b/app-mobilephone/gammu/files/gammu-1.13.0-fixups.patch
new file mode 100644
index 000000000000..68f2818a088e
--- /dev/null
+++ b/app-mobilephone/gammu/files/gammu-1.13.0-fixups.patch
@@ -0,0 +1,113 @@
+diff -Nru gammu-1.13.0.orig/common/misc/misc.h gammu-1.13.0/common/misc/misc.h
+--- gammu-1.13.0.orig/common/misc/misc.h 2007-08-03 12:19:04.000000000 +0300
++++ gammu-1.13.0/common/misc/misc.h 2007-09-06 12:55:36.000000000 +0300
+@@ -22,7 +22,7 @@
+
+ /* ------------------------------------------------------------------------- */
+
+-#define MAX_LINES 50
++#define MAX_LINES 512
+
+ typedef struct {
+ int numbers[MAX_LINES*2];
+diff -Nru gammu-1.13.0.orig/common/service/backup/backtext.c gammu-1.13.0/common/service/backup/backtext.c
+--- gammu-1.13.0.orig/common/service/backup/backtext.c 2007-08-03 16:20:04.000000000 +0300
++++ gammu-1.13.0/common/service/backup/backtext.c 2007-09-06 12:55:36.000000000 +0300
+@@ -903,7 +903,12 @@
+
+ static void SaveRingtoneEntry(FILE *file, GSM_Ringtone *ringtone, bool UseUnicode)
+ {
+- unsigned char buffer[45000];
++ unsigned char *buffer;
++
++ buffer = (unsigned char *)malloc(32 > 2 * ringtone->NokiaBinary.Length ?
++ 32 : 2 * ringtone->NokiaBinary.Length);
++ if (buffer == NULL)
++ return;
+
+ sprintf(buffer,"Location = %i%c%c",ringtone->Location,13,10);
+ SaveBackupText(file, "", buffer, UseUnicode);
+@@ -926,6 +931,8 @@
+ }
+ sprintf(buffer,"%c%c",13,10);
+ SaveBackupText(file, "", buffer, UseUnicode);
++
++ free(buffer);
+ }
+
+ static void SaveOperatorEntry(FILE *file, GSM_Bitmap *bitmap, bool UseUnicode)
+diff -Nru gammu-1.13.0.orig/gammu/backup.c gammu-1.13.0/gammu/backup.c
+--- gammu-1.13.0.orig/gammu/backup.c 2007-08-01 17:36:52.000000000 +0300
++++ gammu-1.13.0/gammu/backup.c 2007-09-06 12:55:36.000000000 +0300
+@@ -165,7 +165,7 @@
+ GSM_FMStation FMStation;
+ GSM_GPRSAccessPoint GPRSPoint;
+ bool DoBackup;
+- char buffer[100];
++ char buffer[GSM_MAX_INFO_LENGTH];
+
+ if (argc == 4 && strcasecmp(argv[3],"-yes") == 0) always_answer_yes = true;
+
+diff -Nru gammu-1.13.0.orig/gammu/common.c gammu-1.13.0/gammu/common.c
+--- gammu-1.13.0.orig/gammu/common.c 2007-08-01 17:36:52.000000000 +0300
++++ gammu-1.13.0/gammu/common.c 2007-09-06 12:55:36.000000000 +0300
+@@ -224,9 +224,10 @@
+ void GSM_Init(bool checkerror)
+ {
+ GSM_File PhoneDB;
+- char model[100];
+- char version[100];
+- unsigned char buff[200], ver[200];
++ char model[GSM_MAX_MODEL_LENGTH];
++ char version[GSM_MAX_VERSION_LENGTH];
++ unsigned char buff[50 + GSM_MAX_MODEL_LENGTH];
++ unsigned char ver[GSM_MAX_VERSION_LENGTH];
+ size_t pos = 0, oldpos = 0, i;
+ GSM_Error error;
+
+diff -Nru gammu-1.13.0.orig/gammu/misc.c gammu-1.13.0/gammu/misc.c
+--- gammu-1.13.0.orig/gammu/misc.c 2007-08-06 12:48:08.000000000 +0300
++++ gammu-1.13.0/gammu/misc.c 2007-09-06 12:55:36.000000000 +0300
+@@ -97,8 +97,8 @@
+
+ void Identify(int argc, char *argv[])
+ {
+- char buffer[100];
+- char date[100];
++ char buffer[GSM_MAX_INFO_LENGTH];
++ char date[GSM_MAX_VERSION_DATE_LENGTH];
+ double num;
+ GSM_Error error;
+
+diff -Nru gammu-1.13.0.orig/gammu/search.c gammu-1.13.0/gammu/search.c
+--- gammu-1.13.0.orig/gammu/search.c 2007-07-31 19:16:08.000000000 +0300
++++ gammu-1.13.0/gammu/search.c 2007-09-06 12:55:36.000000000 +0300
+@@ -60,7 +60,7 @@
+ void SearchPrintPhoneInfo(OneDeviceInfo * Info, int index, GSM_StateMachine *sm)
+ {
+ GSM_Error error;
+- char buffer[100];
++ char buffer[GSM_MAX_INFO_LENGTH];
+
+ error = GSM_GetManufacturer(sm, buffer);
+
+diff -Nru gammu-1.13.0.orig/include/gammu-limits.h gammu-1.13.0/include/gammu-limits.h
+--- gammu-1.13.0.orig/include/gammu-limits.h 2007-07-23 18:31:42.000000000 +0300
++++ gammu-1.13.0/include/gammu-limits.h 2007-09-06 12:55:36.000000000 +0300
+@@ -49,6 +49,16 @@
+ #define GSM_MAX_IMEI_LENGTH 20
+
+ /**
++ * Maximal length of various phone information. Just a shorcut for
++ * functions doing whole identification and use one buffer.
++ *
++ * \ingroup Limits
++ */
++#define GSM_MAX_INFO_LENGTH MAX(MAX(MAX(GSM_MAX_VERSION_LENGTH, \
++ GSM_MAX_IMEI_LENGTH), GSM_MAX_MODEL_LENGTH), \
++ GSM_MAX_MANUFACTURER_LENGTH)
++
++/**
+ * Maximal count of SMS messages in folder.
+ *
+ * \ingroup Limits
diff --git a/app-mobilephone/gammu/gammu-1.13.0.ebuild b/app-mobilephone/gammu/gammu-1.13.0.ebuild
new file mode 100644
index 000000000000..31bb41d3a9e2
--- /dev/null
+++ b/app-mobilephone/gammu/gammu-1.13.0.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-mobilephone/gammu/gammu-1.13.0.ebuild,v 1.1 2007/09/06 10:03:35 mrness Exp $
+
+inherit eutils multilib
+
+DESCRIPTION="a fork of the gnokii project, a tool to handle your cellular phone"
+HOMEPAGE="http://www.gammu.org"
+SRC_URI="ftp://dl.cihar.com/gammu/releases/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="debug bluetooth irda mysql postgres nls"
+
+RDEPEND="bluetooth? ( net-wireless/bluez-libs )
+ mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql )
+ dev-util/dialog"
+DEPEND="${RDEPEND}
+ irda? ( virtual/os-headers )
+ nls? ( sys-devel/gettext )
+ dev-util/cmake"
+
+# Supported languages and translated documentation
+# Be sure all languages are prefixed with a single space!
+MY_AVAILABLE_LINGUAS=" cs de es it pl ru"
+IUSE="${IUSE} ${MY_AVAILABLE_LINGUAS// / linguas_}"
+
+src_unpack() {
+ unpack ${A}
+
+ epatch "${FILESDIR}/${P}-fixups.patch"
+
+ # sys-devel/gettext is needed for creating .mo files
+ cd "${S}"
+ local lang
+ for lang in ${MY_AVAILABLE_LINGUAS} ; do
+ if ! use linguas_${lang} ; then
+ sed -i -e "/^[ \t]*${lang}[ \t]*$/d" CMakeLists.txt
+ fi
+ done
+}
+
+my_use_with() {
+ local WITH_PREFIX
+ if [ -n "${2}" ]; then
+ WITH_PREFIX="-DWITH_${2}"
+ else
+ WITH_PREFIX="-DWITH_${1}"
+ fi
+ if use $1 ; then
+ echo ${WITH_PREFIX}=ON
+ else
+ echo ${WITH_PREFIX}=OFF
+ fi
+}
+
+src_compile() {
+ local myconf="$(my_use_with bluetooth Bluez) \
+ $(my_use_with irda IrDA) \
+ $(my_use_with mysql MySQL) \
+ $(my_use_with postgres Postgres)"
+ use debug && myconf="${myconf} -DCMAKE_BUILD_TYPE=Debug"
+
+ mkdir "${S}/build" && \
+ cd "${S}/build" && \
+ cmake .. \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DINSTALL_LIB_DIR=/usr/$(get_libdir) \
+ -DINSTALL_DOC_DIR="/usr/share/doc/${P}" \
+ -DENABLE_SHARED=ON \
+ -DHAVE_SIN=NO \
+ ${myconf} || die "cmake failed"
+ emake || die "make failed"
+}
+
+src_install () {
+ cd "${S}/build"
+ make DESTDIR="${D}" install || die "install failed"
+}