erofs-utils: lib: gzran: fix corruption due to incorrect dictionary recovery
PATCH 1/1 erofs-utils: lib: gzran: fix corruption due to incorrect dictionary recovery
The dictionary was incorrectly copied by only one byte, leading to corruption during gzran read.
Fix the memcpy size argument to copy the entire dictionary buffer instead of a single byte.
Reported-by Chengyu Zhu <[email protected]>
Signed-off-by Gao Xiang <[email protected]>
--- lib/gzran.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/gzran.c +1 -1
@@ -362,7 +362,7 @@ struct erofs_vfile *erofs_gzran_zinfo_open(struct erofs_vfile *vin,for (; i < ios->entries; ++i, ++c) { ios->cp[i].in_bitpos = (le64_to_cpu (c->in) <<3 ) | c->bits; ios->cp[i].outpos =le64_to_cpu (c->out); -memcpy (ios->cp[i].window, c->window,sizeof (*c->window)); +memcpy (ios->cp[i].window, c->window,sizeof (c->window)); } ios->vin = vin; vf->ops = &erofs_gzran_ios_vfops;
Signature · 1 line
2.39.5