Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

system-vold: Commit

system/vold


Commit MetaInfo

Revisione0217042b9438dc2656b7581af8ac063390a8eca (tree)
Time2018-12-04 23:26:26
AuthorLuca Stefani <luca.stefani.ge1@gmai...>
CommiterLuca Stefani

Log Message

Android 9.0.0 release 21
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCXAVt8wAKCRDorT+BmrEO
eFKpAJ9Njw/0hPi5XYyULgQA75hRM+QyXQCeJIrlKbn8Kwcho8KY/5sdjXSe5NU=
=Bij9
-----END PGP SIGNATURE-----

Merge tag 'android-9.0.0_r21' into lineage-16.0-android-9.0.0_r21

Android 9.0.0 release 21

* tag 'android-9.0.0_r21':

[DO NOT MERGE] Fix signedness mismatch and integer underflow

Change-Id: I6fd3008afbf848d3e4df1396201a061f0bc3087a

Change Summary

Incremental Difference

--- a/cryptfs.cpp
+++ b/cryptfs.cpp
@@ -2544,24 +2544,25 @@ int cryptfs_changepw(int crypt_type, const char *newpw)
25442544 static unsigned int persist_get_max_entries(int encrypted) {
25452545 struct crypt_mnt_ftr crypt_ftr;
25462546 unsigned int dsize;
2547- unsigned int max_persistent_entries;
25482547
25492548 /* If encrypted, use the values from the crypt_ftr, otherwise
25502549 * use the values for the current spec.
25512550 */
25522551 if (encrypted) {
25532552 if (get_crypt_ftr_and_key(&crypt_ftr)) {
2554- return -1;
2553+ /* Something is wrong, assume no space for entries */
2554+ return 0;
25552555 }
25562556 dsize = crypt_ftr.persist_data_size;
25572557 } else {
25582558 dsize = CRYPT_PERSIST_DATA_SIZE;
25592559 }
25602560
2561- max_persistent_entries = (dsize - sizeof(struct crypt_persist_data)) /
2562- sizeof(struct crypt_persist_entry);
2563-
2564- return max_persistent_entries;
2561+ if (dsize > sizeof(struct crypt_persist_data)) {
2562+ return (dsize - sizeof(struct crypt_persist_data)) / sizeof(struct crypt_persist_entry);
2563+ } else {
2564+ return 0;
2565+ }
25652566 }
25662567
25672568 static int persist_get_key(const char *fieldname, char *value)
Show on old repository browser