[ostree] ostree: avoid a segfault



commit 07f67f3baf1e3c3877eb12e10a4549772106db1a
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat May 5 20:59:23 2012 -0400

    ostree: avoid a segfault
    
    When running ostree --repo=/ostree/repo without further arguments,
    we end up calling strcmp with one argument being NULL.

 src/ostree/ot-main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c
index f328faf..3bdc4b3 100644
--- a/src/ostree/ot-main.c
+++ b/src/ostree/ot-main.c
@@ -140,7 +140,7 @@ ostree_main (int    argc,
   builtin = builtins;
   while (builtin->name)
     {
-      if (strcmp (cmd, builtin->name) == 0)
+      if (g_strcmp0 (cmd, builtin->name) == 0)
         break;
       builtin++;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]