From a0d4570db9e9aa8618b21e27322450b188be75f8 Mon Sep 17 00:00:00 2001 From: Alexandra Ellwood Date: Wed, 1 Oct 2008 21:00:49 +0000 Subject: [PATCH] Reversed sense of checks for NUL character in empty string. Fixed ticket: 6055 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20802 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kim/agent/mac/ServerDemux.m | 2 +- src/kim/lib/kim_selection_hints.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/kim/agent/mac/ServerDemux.m b/src/kim/agent/mac/ServerDemux.m index 595da0656..ea1943592 100644 --- a/src/kim/agent/mac/ServerDemux.m +++ b/src/kim/agent/mac/ServerDemux.m @@ -459,7 +459,7 @@ static int32_t kim_handle_request_handle_error (mach_port_t in_client_port, if (!err) { err = k5_ipc_stream_read_string (in_request_stream, &identity_string); /* Can be empty string "" if there is no identity */ - if (!err && identity_string[0]) { + if (!err && !identity_string[0]) { k5_ipc_stream_free_string (identity_string); identity_string = KIM_IDENTITY_ANY; } diff --git a/src/kim/lib/kim_selection_hints.c b/src/kim/lib/kim_selection_hints.c index a04541bd7..795435359 100644 --- a/src/kim/lib/kim_selection_hints.c +++ b/src/kim/lib/kim_selection_hints.c @@ -651,7 +651,7 @@ kim_error kim_selection_hints_read_from_stream (kim_selection_hints io_selection err = k5_ipc_stream_read_string (io_stream, &explanation); if (!err) { - if (explanation[0]) { + if (!explanation[0]) { err = kim_string_copy (&io_selection_hints->explanation, explanation); } else { @@ -678,7 +678,7 @@ kim_error kim_selection_hints_read_from_stream (kim_selection_hints io_selection err = k5_ipc_stream_read_string (io_stream, &service_identity); if (!err) { - if (service_identity[0]) { + if (!service_identity[0]) { err = kim_string_copy (&io_selection_hints->service_identity, service_identity); } else { @@ -696,7 +696,7 @@ kim_error kim_selection_hints_read_from_stream (kim_selection_hints io_selection err = k5_ipc_stream_read_string (io_stream, &client_realm); if (!err) { - if (client_realm[0]) { + if (!client_realm[0]) { err = kim_string_copy (&io_selection_hints->client_realm, client_realm); } else { @@ -714,7 +714,7 @@ kim_error kim_selection_hints_read_from_stream (kim_selection_hints io_selection err = k5_ipc_stream_read_string (io_stream, &user); if (!err) { - if (user[0]) { + if (!user[0]) { err = kim_string_copy (&io_selection_hints->user, user); } else { err = kim_selection_hints_set_hint (io_selection_hints, @@ -731,7 +731,7 @@ kim_error kim_selection_hints_read_from_stream (kim_selection_hints io_selection err = k5_ipc_stream_read_string (io_stream, &service_realm); if (!err) { - if (service_realm[0]) { + if (!service_realm[0]) { err = kim_string_copy (&io_selection_hints->service_realm, service_realm); } else { @@ -749,7 +749,7 @@ kim_error kim_selection_hints_read_from_stream (kim_selection_hints io_selection err = k5_ipc_stream_read_string (io_stream, &service); if (!err) { - if (service[0]) { + if (!service[0]) { err = kim_string_copy (&io_selection_hints->service, service); } else { err = kim_selection_hints_set_hint (io_selection_hints, @@ -766,7 +766,7 @@ kim_error kim_selection_hints_read_from_stream (kim_selection_hints io_selection err = k5_ipc_stream_read_string (io_stream, &server); if (!err) { - if (server[0]) { + if (!server[0]) { err = kim_string_copy (&io_selection_hints->server, server); } else { err = kim_selection_hints_set_hint (io_selection_hints, -- 2.26.2