Skip to content

Commit

Permalink
login-common: Consistently truncate client SASL input at first NUL
Browse files Browse the repository at this point in the history
The input is supposed to be base64-encoded, so there's no need to support
actual NUL characters. The previous code truncated at NULs, but could have
kept appending more data to the value. This could have produced somewhat
random results.
  • Loading branch information
sirainen committed Aug 30, 2018
1 parent 217c2c0 commit d1e71fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/login-common/client-common-auth.c
Expand Up @@ -617,7 +617,7 @@ int client_auth_read_line(struct client *client)
client_destroy(client, "Authentication response too large");
return -1;
}
str_append_n(client->auth_response, data, i);
str_append_data(client->auth_response, data, i);
i_stream_skip(client->input, i == size ? size : i+1);

/* drop trailing \r */
Expand Down

0 comments on commit d1e71fa

Please sign in to comment.