lib/krb5: fix _krb5_get_int64 on 32-bit systems
commit9d1bfab9882d0aa14ae0981e6667c93db93ffc5d
authorStefan Metzmacher <metze@samba.org>
Wed, 16 Nov 2022 15:05:56 +0000 (16 10:05 -0500)
committerJeffrey Altman <jaltman@auristor.com>
Wed, 16 Nov 2022 17:23:40 +0000 (16 12:23 -0500)
tree2342a430c1b730785b3cb5d368c9b3129f7232e0
parentefeab17c030bcd35674ace0927e6afc67656b02a
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 <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
CVE: CVE-2022-42898
Samba-BUG: https://bugzilla.samba.org/show_bug.cgi?id=15203
lib/krb5/store-int.c