mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-01-05 08:36:10 +00:00
lz: Avoid buffer reading overflow checking for image type
The type of the image is just copied from network without any check and later used for array indexing. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Uri Lublin <uril@redhat.com>
This commit is contained in:
parent
16aa8c98d8
commit
3050b4e1f6
@ -593,6 +593,9 @@ void lz_decode_begin(LzContext *lz, uint8_t *io_ptr, unsigned int num_io_bytes,
|
||||
}
|
||||
|
||||
encoder->type = (LzImageType)decode_32(encoder);
|
||||
if (encoder->type <= LZ_IMAGE_TYPE_INVALID || encoder->type > LZ_IMAGE_TYPE_A8) {
|
||||
encoder->usr->error(encoder->usr, "invalid lz type %d\n", encoder->type);
|
||||
}
|
||||
encoder->width = decode_32(encoder);
|
||||
encoder->height = decode_32(encoder);
|
||||
encoder->stride = decode_32(encoder);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user