Skip to content

Commit dadc53f

Browse files
committed
MDEV-19882 pam v2: auth_pam_tool truncates passwords that are not null-terminated
Don't assume that passwords (and other conv replies) are zero-terminated. If they are, though, strndup() down below will take care of that.
1 parent d67ea81 commit dadc53f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugin/auth_pam/auth_pam_tool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static int roundtrip(struct param *param, const unsigned char *buf,
3333
if (write(1, &b, 1) < 1 || write_string(1, buf, buf_len))
3434
return -1;
3535
*pkt= (unsigned char *) param->buf;
36-
return read_string(0, (char *) param->buf, (int) sizeof(param->buf)) - 1;
36+
return read_string(0, (char *) param->buf, (int) sizeof(param->buf));
3737
}
3838

3939
typedef struct st_mysql_server_auth_info

0 commit comments

Comments
 (0)