help-gsasl
[Top][All Lists]
Advanced

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

gsasl_client_suggest_mechanism() prefix matching


From: Kevin J. McCarthy
Subject: gsasl_client_suggest_mechanism() prefix matching
Date: Thu, 23 Dec 2021 15:49:34 -0800
User-agent: Mutt/2.1.4+97 (68caf914) (2021-12-23)

I was looking at how gsasl_client_suggest_mechanism() worked, and noticed it seems to accept prefixes matches inside the mechlist parameter.

It grabs a valid mechanism using strspn():
  len = strspn (mechlist + i, GSASL_VALID_MECHANISM_CHARACTERS);
and then further below checks:
  if (strncmp (ctx->client_mechs[j].name, mechlist + i, len) == 0)

But this would seem to allow a substring prefix to suggest that mechanism. If that wasn't intended, would it be worth adding another check, something like:
  if ((strlen (ctx->client_mechs[j].name) == len) &&
      (strncmp (ctx->client_mechs[j].name, mechlist + i, len) == 0))

Thank you!

-Kevin

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]