Skip to content

Commit 9d1bfab

Browse files
metze-sambajaltman
authored andcommitted
lib/krb5: fix _krb5_get_int64 on 32-bit systems
On systems where 'unsigned long' is 32-bits and the 'size' parameter is set to 8 and the bytes are: 0x78 0x00 0x00 0x00 0x00 0x00 0x00 0x00 When 'i' becomes 4 'v' will be 0 again. As 'unsigned long' is only able to hold 4 bytes. Change the type of 'v' from 'unsigned long' to 'uint64_t' which matches the type of the output parameter 'value'. Signed-off-by: Stefan Metzmacher <[email protected]> Reviewed-by: Ralph Boehme <[email protected]> CVE: CVE-2022-42898 Samba-BUG: https://bugzilla.samba.org/show_bug.cgi?id=15203
1 parent efeab17 commit 9d1bfab

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/krb5/store-int.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ KRB5_LIB_FUNCTION krb5_ssize_t KRB5_LIB_CALL
4949
_krb5_get_int64(void *buffer, uint64_t *value, size_t size)
5050
{
5151
unsigned char *p = buffer;
52-
unsigned long v = 0;
52+
uint64_t v = 0;
5353
size_t i;
5454
for (i = 0; i < size; i++)
5555
v = (v << 8) + p[i];

0 commit comments

Comments
 (0)