[recipes] Avoid a crash with empty chefs
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Avoid a crash with empty chefs
- Date: Mon, 13 Feb 2017 00:12:10 +0000 (UTC)
commit 556c88a31c4aced4986eedb9ad9b8b311601526f
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Feb 12 16:23:21 2017 -0500
Avoid a crash with empty chefs
Avoid calling strsplit on fullname if it is NULL.
src/gr-chef.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-chef.c b/src/gr-chef.c
index c91afb2..0016b7a 100644
--- a/src/gr-chef.c
+++ b/src/gr-chef.c
@@ -216,7 +216,7 @@ gr_chef_get_id (GrChef *chef)
const char *
gr_chef_get_name (GrChef *chef)
{
- if (!chef->name) {
+ if (!chef->name && chef->fullname) {
g_auto(GStrv) strv = NULL;
strv = g_strsplit (chef->fullname, " ", 0);
chef->name = g_strdup (strv[0]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]