The error is in function ads_get_machine_kvno. The unsigned variable kvno is assigned a negative number. The function itself returns an uint32_t, but the return value can be signed.
it's not nice imho but obviously intended, anyone who would like to pretty this up can reopen this bug report.