Clear memory before use. Fixes bug where hash of licensefilename

differs between load and save.

Thanks to Florent Peterschmitt for reporting,testing and patch.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1788 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Henrik Andersson 2014-02-19 08:02:07 +00:00
parent 6364680a8c
commit 6e5bb07c9c

View File

@ -1678,6 +1678,7 @@ load_licence(unsigned char **data)
if (home == NULL)
return -1;
memset(hi, 0, sizeof(hi));
snprintf((char *) hi, 16, "%s", g_hostname);
sec_hash_sha1_16(ho, hi, g_static_rdesktop_salt_16);
sec_hash_to_string(hash, sizeof(hash), ho, sizeof(ho));
@ -1726,6 +1727,7 @@ save_licence(unsigned char *data, int length)
return;
}
memset(hi, 0, sizeof(hi));
snprintf((char *) hi, 16, "%s", g_hostname);
sec_hash_sha1_16(ho, hi, g_static_rdesktop_salt_16);
sec_hash_to_string(hash, sizeof(hash), ho, sizeof(ho));