diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-15 21:38:45 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-15 21:38:45 +0000 |
commit | 88dc4b8f14ffebe26e83b49cfb9971d5f08c4ec4 (patch) | |
tree | e2efaa696497cedc92627849723ef1c48b764f6c | |
parent | 441794a565e1c48168311e1c98ba258ed3fa0e49 (diff) | |
parent | b7af06bff64a85a53db9fb5a32f0860c7f2588be (diff) | |
download | fsck_msdos-aml_tz3_314012010.tar.gz |
Snap for 8730993 from b7af06bff64a85a53db9fb5a32f0860c7f2588be to mainline-tzdata3-releaseaml_tz3_314012070aml_tz3_314012050aml_tz3_314012010aml_tz3_313110000aml_tz3_312511020aml_tz3_312511010aml_tz3_312410020aml_tz3_312410010android12-mainline-tzdata3-releaseaml_tz3_314012010
Change-Id: Ic57e407571474a007159a299de7baf028b24a1a2
-rw-r--r-- | dir.c | 21 |
1 files changed, 4 insertions, 17 deletions
@@ -400,21 +400,8 @@ checksize(struct fat_descriptor *fat, u_char *p, struct dosDirEntry *dir) if (dir->head == CLUST_FREE) { physicalSize = 0; } else { - if (!fat_is_valid_cl(fat, dir->head) || !fat_is_cl_head(fat, dir->head)) { - pwarn("Directory entry %s of size %u referencing invalid cluster %u\n", - fullpath(dir), dir->size, dir->head); - if (ask(1, "Truncate")) { - p[28] = p[29] = p[30] = p[31] = 0; - p[26] = p[27] = 0; - if (boot->ClustMask == CLUST32_MASK) - p[20] = p[21] = 0; - dir->size = 0; - dir->head = CLUST_FREE; - return FSDIRMOD; - } else { - return FSERROR; - } - } + if (!fat_is_valid_cl(fat, dir->head)) + return FSERROR; ret = checkchain(fat, dir->head, &chainsize); /* * Upon return, chainsize would hold the chain length @@ -435,8 +422,8 @@ checksize(struct fat_descriptor *fat, u_char *p, struct dosDirEntry *dir) physicalSize = (u_int64_t)chainsize * boot->ClusterSize; } if (physicalSize < dir->size) { - pwarn("size of %s is %u, should at most be %ju\n", - fullpath(dir), dir->size, (uintmax_t)physicalSize); + pwarn("size of %s is %u, should at most be %" PRIu64 "\n", + fullpath(dir), dir->size, physicalSize); if (ask(1, "Truncate")) { dir->size = physicalSize; p[28] = (u_char)physicalSize; |