Re: [PATCH] media: vidtv: Fix a wild pointer dereference in vidtv_channel_pmt_match_sections()
From: Daniel Almeida
Date: Thu Dec 02 2021 - 12:07:12 EST
Hi Zhou Qingyang, thanks for the patch.
Yes this is a real issue.
+
+ if (!tail) {
+ vidtv_psi_pmt_stream_destroy(head);
+ dev_warn_ratelimited(m->dev,
+ "No enough memory for vidtv_psi_pmt_stream_init");
+ return;
+ }
Yes this is the right thing to do, as vidtv_psi_pmt_stream_destroy will
free the stream chain and all descriptors associated with it, if any.
By then aborting out of this function, we will have a PMT section
without any streams. This is OK if the allocation failed.
Reviewed-by Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>
Thanks,
-- Daniel