[file-roller/gnome-3-12] fr-command-rar: check for NULL in name_field
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller/gnome-3-12] fr-command-rar: check for NULL in name_field
- Date: Mon, 1 Sep 2014 18:01:28 +0000 (UTC)
commit c49934c10456b472bcd7148c044e6b1bc849b9f2
Author: Igor Gnatenko <i gnatenko brain gmail com>
Date: Fri Aug 29 15:19:21 2014 +0600
fr-command-rar: check for NULL in name_field
When I tried to open rar archive from floppy disk (floppy corrupted), I
got crash.
149 if (*name_field == '/') {
(gdb) p name_field
$3 = 0x0
Sure, it can't be dereferenced.
Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1135409
Reference: https://bugzilla.gnome.org/show_bug.cgi?id=735657
Signed-off-by: Igor Gnatenko <i gnatenko brain gmail com>
src/fr-command-rar.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/fr-command-rar.c b/src/fr-command-rar.c
index 7619225..06951c5 100644
--- a/src/fr-command-rar.c
+++ b/src/fr-command-rar.c
@@ -146,6 +146,9 @@ parse_name_field (char *line,
else
name_field = g_strdup (line + 1);
+ if (name_field == NULL)
+ return NULL;
+
if (*name_field == '/') {
fdata->full_path = g_strdup (name_field);
fdata->original_path = fdata->full_path;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]