Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

system-vold: 提交

system/vold


Commit MetaInfo

修订版b1498d1d87c22d7c1cb53461a3991f15e87bc6e9 (tree)
时间2018-10-12 08:10:57
作者Rubin Xu <rubinxu@goog...>
Commiterandroid-build-merger

Log Message

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

Change-Id: Ia169a9fc152f100a9567f2c47ef5a2e46358aa52

更改概述

差异

--- a/cryptfs.cpp
+++ b/cryptfs.cpp
@@ -2495,24 +2495,25 @@ int cryptfs_changepw(int crypt_type, const char *newpw)
24952495 static unsigned int persist_get_max_entries(int encrypted) {
24962496 struct crypt_mnt_ftr crypt_ftr;
24972497 unsigned int dsize;
2498- unsigned int max_persistent_entries;
24992498
25002499 /* If encrypted, use the values from the crypt_ftr, otherwise
25012500 * use the values for the current spec.
25022501 */
25032502 if (encrypted) {
25042503 if (get_crypt_ftr_and_key(&crypt_ftr)) {
2505- return -1;
2504+ /* Something is wrong, assume no space for entries */
2505+ return 0;
25062506 }
25072507 dsize = crypt_ftr.persist_data_size;
25082508 } else {
25092509 dsize = CRYPT_PERSIST_DATA_SIZE;
25102510 }
25112511
2512- max_persistent_entries = (dsize - sizeof(struct crypt_persist_data)) /
2513- sizeof(struct crypt_persist_entry);
2514-
2515- return max_persistent_entries;
2512+ if (dsize > sizeof(struct crypt_persist_data)) {
2513+ return (dsize - sizeof(struct crypt_persist_data)) / sizeof(struct crypt_persist_entry);
2514+ } else {
2515+ return 0;
2516+ }
25162517 }
25172518
25182519 static int persist_get_key(const char *fieldname, char *value)
Show on old repository browser