Package: xarchiver
Version: 1:0.5.2+20130119+dfsg-1
Severity: normal

While i was investigating another bug, i found this one. 

Let's assume there is a password protected archive named
xarchiver.doc.zip and you would like to extract it to a directory
which you have to specify on the commandline with the -x switch.

xarchiver -x testdir xarchiver.doc.zip

will extract the content of the archive to testdir after asking for
the password.

But if you mistype the archive name like

xarchiver -x testdir xarchiver.doc.z

xarchiver will segfault. 

I have attached a patch which checks whether the archive exists or
not and solves the issue.



-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages xarchiver depends on:
ii  libc6               2.13-38
ii  libgdk-pixbuf2.0-0  2.26.1-1
ii  libglib2.0-0        2.33.12+really2.32.4-5
ii  libgtk2.0-0         2.24.10-2
ii  libpango1.0-0       1.30.0-1

Versions of packages xarchiver recommends:
ii  bzip2       1.0.6-4
ii  p7zip-full  9.20.1~dfsg.1-4
ii  unzip       6.0-8
ii  xdg-utils   1.1.0~rc1+git20111210-6

Versions of packages xarchiver suggests:
pn  arj         <none>
pn  lha         <none>
pn  rar         <none>
pn  rpm         <none>
ii  unrar-free  1:0.0.1+cvs20071127-2
ii  zip         3.0-6

-- no debconf information
From: Markus Koschany <a...@gambaru.de>
Date: Thu, 28 Feb 2013 17:45:50 +0100
Subject: fix segfault non-existent archive cmdl switch x

---
 src/main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c
index a6a7f93..a6e05e3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -141,7 +141,7 @@ int main (int argc, char **argv)
 		/* Switch -x */
 		if (extract_path != NULL)
 		{
-			if (argv[1] == NULL)
+			if (argv[1] == NULL || archive == NULL)
 			{
 				response = xa_show_message_dialog (NULL,GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("Can't extract files from the archive:"),_("You missed the archive name!\n"));
 				return -1;

Reply via email to