user_data: fix crashing bug...
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 15 Jul 2013 08:49:53 +0000 (15 11:49 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Mon, 15 Jul 2013 08:49:53 +0000 (15 11:49 +0300)
Crap.  I don't know how I missed this bug.  I was pretty sure I had tested
this code for some days before I did the commit.  But as soon as you do a
release then you always find an embarrassing crashing bug.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_user_data.c

index 78447db..28332ff 100644 (file)
@@ -517,8 +517,10 @@ static void print_returned_user_data(int return_id, char *return_ranges, struct
 
                if (slist_has_state(tmp->possible, &user_data_set))
                        passed_or_new = "1";
-               if (slist_has_state(tmp->possible, &user_data_passed))
+               else if (slist_has_state(tmp->possible, &user_data_passed))
                        passed_or_new = "2";
+               else
+                       continue;
 
                sql_insert_return_states(return_id, return_ranges, USER_DATA,
                                param, param_name, passed_or_new);