rpms/file-roller/F-12 file-roller-arj-crash.patch, NONE, 1.1 file-roller.spec, 1.163, 1.164

Matthias Clasen mclasen at fedoraproject.org
Thu Jan 7 22:18:10 UTC 2010


Author: mclasen

Update of /cvs/pkgs/rpms/file-roller/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28936

Modified Files:
	file-roller.spec 
Added Files:
	file-roller-arj-crash.patch 
Log Message:
Fix a crash in the arj loader


file-roller-arj-crash.patch:
 fr-command-arj.c |   17 +++++++++++++----
 fr-command-arj.h |    1 +
 2 files changed, 14 insertions(+), 4 deletions(-)

--- NEW FILE file-roller-arj-crash.patch ---
diff --git a/src/fr-command-arj.c b/src/fr-command-arj.c
index 0a8840c..ee214c0 100644
--- a/src/fr-command-arj.c
+++ b/src/fr-command-arj.c
@@ -107,7 +107,7 @@ list__process_line (char     *line,
 		return;
 	}
 
-	if (line[0] != ' ') { /* Read the filename. */
+	if (g_regex_match (arj_comm->filename_line_regex, line, 0, NULL)) { /* Read the filename. */
 		FileData   *fdata;
 		const char *name_field;
 
@@ -142,7 +142,7 @@ list__process_line (char     *line,
 		fields = split_line (line, 10);
 		fdata->size = g_ascii_strtoull (fields[2], NULL, 10);
 		fdata->modified = mktime_from_string (fields[5], fields[6]);
-		if (strcmp (fields[1], "MS-DOS") == 0)
+		if ((strcmp (fields[1], "MS-DOS") == 0) || (strcmp (fields[1], "WIN32") == 0))
 			fdata->encrypted = (g_ascii_strcasecmp (fields[7], "11") == 0);
 		else
 			fdata->encrypted = (g_ascii_strcasecmp (fields[9], "11") == 0);
@@ -375,6 +375,8 @@ fr_command_arj_class_init (FrCommandArjClass *class)
 static void
 fr_command_arj_init (FrCommand *comm)
 {
+	FrCommandArj *arj_comm;
+
 	comm->propAddCanUpdate             = TRUE;
 	comm->propAddCanReplace            = TRUE;
 	comm->propAddCanStoreFolders       = FALSE;
@@ -384,17 +386,24 @@ fr_command_arj_init (FrCommand *comm)
 	comm->propPassword                 = TRUE;
 	comm->propTest                     = TRUE;
 
-	FR_COMMAND_ARJ (comm)->list_started = FALSE;
-	FR_COMMAND_ARJ (comm)->fdata = FALSE;
+	arj_comm = FR_COMMAND_ARJ (comm);
+	arj_comm->list_started = FALSE;
+	arj_comm->fdata = FALSE;
+	arj_comm->filename_line_regex = g_regex_new ("[0-9]+\\) ", G_REGEX_OPTIMIZE, 0, NULL);
 }
 
 
 static void
 fr_command_arj_finalize (GObject *object)
 {
+	FrCommandArj *arj_comm;
+
 	g_return_if_fail (object != NULL);
 	g_return_if_fail (FR_IS_COMMAND_ARJ (object));
 
+	arj_comm = FR_COMMAND_ARJ (object);
+	g_regex_unref (arj_comm->filename_line_regex);
+
 	/* Chain up */
 	if (G_OBJECT_CLASS (parent_class)->finalize)
 		G_OBJECT_CLASS (parent_class)->finalize (object);
diff --git a/src/fr-command-arj.h b/src/fr-command-arj.h
index 37af69d..b1b860c 100644
--- a/src/fr-command-arj.h
+++ b/src/fr-command-arj.h
@@ -44,6 +44,7 @@ struct _FrCommandArj
 	gboolean  list_started;
 	int       line_no;
 	FileData *fdata;
+	GRegex   *filename_line_regex;
 };
 
 struct _FrCommandArjClass


Index: file-roller.spec
===================================================================
RCS file: /cvs/pkgs/rpms/file-roller/F-12/file-roller.spec,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -p -r1.163 -r1.164
--- file-roller.spec	17 Dec 2009 02:10:09 -0000	1.163
+++ file-roller.spec	7 Jan 2010 22:18:09 -0000	1.164
@@ -11,12 +11,15 @@
 Summary:	Tool for viewing and creating archives
 Name:		file-roller
 Version:	2.28.2
-Release: 	1%{?dist}
+Release: 	2%{?dist}
 License:	GPLv2+
 Group:		Applications/Archiving
 URL:		http://download.gnome.org/sources/file-roller/
 Source:		http://download.gnome.org/sources/file-roller/2.28/file-roller-%{version}.tar.bz2
 
+# https://bugzilla.gnome.org/show_bug.cgi?id=606074
+Patch0:		file-roller-arj-crash.patch
+
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: glib2-devel >= %{glib2_version}
 BuildRequires: pango-devel >= %{pango_version}
@@ -50,6 +53,7 @@ such as tar or zip files.
 
 %prep
 %setup -q
+%patch0 -p1 -b .arj-crash
 
 %build
 %configure --disable-scrollkeeper --disable-static
@@ -126,6 +130,9 @@ fi
 %{_datadir}/icons/hicolor/scalable/apps/file-roller.svg
 
 %changelog
+* Thu Jan  7 2010 Matthias Clasen <mclasen at redhat.com> 2.28.2-2
+- Fix a crash in the arj loader (#551717)
+
 * Wed Dec 16 2009 Matthias Clasen <mclasen at redhat.com> 2.28.2-1
 - Update to 2.28.2
 - See http://download.gnome.org/sources/file-roller/2.28/file-roller-2.28.2.news




More information about the fedora-extras-commits mailing list