diff --git a/common/image.c b/common/image.c
index f084d2baed3e0685937c6d4be3b73eb8e54add3a..852a96fab8b89b0c9b59ed9d0b606c814180d6c1 100644
--- a/common/image.c
+++ b/common/image.c
@@ -2820,6 +2820,11 @@ int fit_image_check_hashes(const void *fit, int image_noffset)
 		}
 	}
 
+	if (noffset == -FDT_ERR_TRUNCATED || noffset == -FDT_ERR_BADSTRUCTURE) {
+		err_msg = " error!\nCorrupted or truncated tree";
+		goto error;
+	}
+
 	return 1;
 
 error: