|
|
677019 |
From 01b93a5522fd0e402401bf6ed3c1ebfde613965e Mon Sep 17 00:00:00 2001
|
|
|
d283c7 |
From: Robbie Harwood <rharwood@redhat.com>
|
|
|
d283c7 |
Date: Tue, 9 Jun 2020 16:23:37 -0400
|
|
|
d283c7 |
Subject: [PATCH] Improve negoex_parse_token() code hygiene
|
|
|
d283c7 |
|
|
|
d283c7 |
If the while loop in negoex_parse_token() runs for zero iterations,
|
|
|
d283c7 |
major will be used initialized. Currently this cannot happen, but
|
|
|
d283c7 |
only because both of the call sites check for zero-length tokens.
|
|
|
d283c7 |
Initialize major for safety.
|
|
|
d283c7 |
|
|
|
d283c7 |
[ghudson@mit.edu: rewrote commit message]
|
|
|
d283c7 |
|
|
|
d283c7 |
(cherry picked from commit 4f91b6f8fa6fe1de662b3fdac0d59b7758ec642a)
|
|
|
d283c7 |
(cherry picked from commit c726a72c68244129eb08b840b92144acfa776573)
|
|
|
d283c7 |
---
|
|
|
d283c7 |
src/lib/gssapi/spnego/negoex_util.c | 2 +-
|
|
|
d283c7 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
d283c7 |
|
|
|
d283c7 |
diff --git a/src/lib/gssapi/spnego/negoex_util.c b/src/lib/gssapi/spnego/negoex_util.c
|
|
|
d283c7 |
index 700368456..99580fd79 100644
|
|
|
d283c7 |
--- a/src/lib/gssapi/spnego/negoex_util.c
|
|
|
d283c7 |
+++ b/src/lib/gssapi/spnego/negoex_util.c
|
|
|
d283c7 |
@@ -454,7 +454,7 @@ negoex_parse_token(OM_uint32 *minor, spnego_gss_ctx_id_t ctx,
|
|
|
d283c7 |
gss_const_buffer_t token,
|
|
|
d283c7 |
struct negoex_message **messages_out, size_t *count_out)
|
|
|
d283c7 |
{
|
|
|
d283c7 |
- OM_uint32 major;
|
|
|
d283c7 |
+ OM_uint32 major = GSS_S_COMPLETE;
|
|
|
d283c7 |
size_t count = 0;
|
|
|
d283c7 |
struct k5input in;
|
|
|
d283c7 |
struct negoex_message *messages = NULL, *newptr;
|