[gnome-control-center] printers: Avoid dereferencing NULL variable
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] printers: Avoid dereferencing NULL variable
- Date: Thu, 20 Oct 2011 15:11:25 +0000 (UTC)
commit 34dadb5ac3581dca86c25ddcce8a08898734261e
Author: Bastien Nocera <hadess hadess net>
Date: Thu Oct 20 15:50:00 2011 +0100
printers: Avoid dereferencing NULL variable
If line is NULL, then buffer is NULL, and buffer[0] points
to nowhere.
panels/printers/pp-new-printer-dialog.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/panels/printers/pp-new-printer-dialog.c b/panels/printers/pp-new-printer-dialog.c
index 7dd0070..8bbd348 100644
--- a/panels/printers/pp-new-printer-dialog.c
+++ b/panels/printers/pp-new-printer-dialog.c
@@ -752,7 +752,7 @@ line_split (gchar *line)
}
}
- if (buffer[0] != '\0')
+ if (buffer && buffer[0] != '\0')
words[j++] = g_strdup (buffer);
result = g_strdupv (words);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]