Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

system-vold: Commit

system/vold


Commit MetaInfo

Révision89858102c2272fb10c040b447eb482ddc497585f (tree)
l'heure2018-10-12 08:16:03
AuteurRubin Xu <rubinxu@goog...>
Commiterandroid-build-merger

Message de Log

Merge "[DO NOT MERGE] Fix signedness mismatch and integer underflow" into oc-dev am: 92e63e3f9b
am: b1498d1d87

Change-Id: Ic7ef94c42d54d4f29c92bad98001bd6e065f5013

Change Summary

Modification

--- a/cryptfs.cpp
+++ b/cryptfs.cpp
@@ -2488,24 +2488,25 @@ int cryptfs_changepw(int crypt_type, const char *newpw)
24882488 static unsigned int persist_get_max_entries(int encrypted) {
24892489 struct crypt_mnt_ftr crypt_ftr;
24902490 unsigned int dsize;
2491- unsigned int max_persistent_entries;
24922491
24932492 /* If encrypted, use the values from the crypt_ftr, otherwise
24942493 * use the values for the current spec.
24952494 */
24962495 if (encrypted) {
24972496 if (get_crypt_ftr_and_key(&crypt_ftr)) {
2498- return -1;
2497+ /* Something is wrong, assume no space for entries */
2498+ return 0;
24992499 }
25002500 dsize = crypt_ftr.persist_data_size;
25012501 } else {
25022502 dsize = CRYPT_PERSIST_DATA_SIZE;
25032503 }
25042504
2505- max_persistent_entries = (dsize - sizeof(struct crypt_persist_data)) /
2506- sizeof(struct crypt_persist_entry);
2507-
2508- return max_persistent_entries;
2505+ if (dsize > sizeof(struct crypt_persist_data)) {
2506+ return (dsize - sizeof(struct crypt_persist_data)) / sizeof(struct crypt_persist_entry);
2507+ } else {
2508+ return 0;
2509+ }
25092510 }
25102511
25112512 static int persist_get_key(const char *fieldname, char *value)
Afficher sur ancien navigateur de dépôt.