Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 89197da

Browse files
iboukrisfrozencemetery
authored andcommitted
Avoid NULL dereference of 'actual_mech_type'
The actual_mech is not promised till we complet the context. This fix a segfault when creating a SecurityContext with SPNEGO mech. [rharwood@redhat.com: Squash with fixup commit]
1 parent 102ea36 commit 89197da

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎gssapi/raw/sec_contexts.pyx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ flags=None, lifetime=None, channel_bindings=None, input_token=None)
204204
input_token_buffer.value = input_token
205205
input_token_buffer.length = len(input_token)
206206

207-
cdef gss_OID actual_mech_type
207+
cdef gss_OID actual_mech_type= GSS_C_NO_OID
208208
cdef gss_buffer_desc output_token_buffer = gss_buffer_desc(0, NULL)
209209
cdef OM_uint32 ret_flags
210210
cdef OM_uint32 output_ttl
@@ -232,7 +232,9 @@ flags=None, lifetime=None, channel_bindings=None, input_token=None)
232232

233233
cdef OID output_mech_type = OID()
234234
if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:
235-
output_mech_type.raw_oid = actual_mech_type[0]
235+
if actual_mech_type is not GSS_C_NO_OID:
236+
output_mech_type.raw_oid = actual_mech_type[0]
237+
236238
return InitSecContextResult(output_context, output_mech_type,
237239
IntEnumFlagSet(RequirementFlag, ret_flags),
238240
output_token,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /