Re: [PATCH] SEGV fixed in dvbpsi_decoder_psi_section_add

Jean-Paul Saman <[email protected]>
Newsgroups gmane.comp.video.videolan.libdvbpsi.devel
Message-ID <CAK9US3Dp5pq_K0cH8TsHuZ07ULz7xHDS81+V0KJ3=F9_n_uugA@mail.gmail.com>
Michael,

The patch looks good. Do you have a test file for me to try?

On Tue, Oct 30, 2012 at 3:11 PM, Michael Kasch - SmartCast
<[email protected]> wrote:
> Dear Jean-Paul,
> i think i found the Problem for the SEGV still occuring.
>
> please find the Patch attached.
>
> Regards,
> Michael
>
> From 6eaca9164219365e4003099df53399f195829c28 Mon Sep 17 00:00:00 2001
> From: Michael Kasch <[email protected]>
> Date: Tue, 30 Oct 2012 15:00:53 +0100
> Subject: [PATCH] src/dvbpsi.c: fix segmentation fault in
>  dvbpsi_decoder_psi_section_add()
>
> When p->i_number == p_section->i_number AND p_prev == NULL, then the
> first element of the list has to be replaced. Since it is the first
> element we have to update the pointer to the list, which is pointing to
> the first element
> ---
>  src/dvbpsi.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/dvbpsi.c b/src/dvbpsi.c
> index d45802e..0555b14 100644
> --- a/src/dvbpsi.c
> +++ b/src/dvbpsi.c
> @@ -272,6 +272,7 @@ bool dvbpsi_decoder_psi_section_add(dvbpsi_decoder_t *p_decoder, dvbpsi_psi_sect
>                  p->p_next = NULL;
>                  dvbpsi_DeletePSISections(p);
>                  p = p_section;

In this case p points to the head of the list ( p =
p_decoder->p_sections), so p = p_section should do the trick.
However I wonder if an compiler optimization causes the crash to happen.

> +                p_decoder->p_sections = p;
>                  b_overwrite = true;
>              }
>              goto out;
> --
> 1.7.10.4
> _______________________________________________
> libdvbpsi-devel mailing list
> [email protected]
> http://mailman.videolan.org/listinfo/libdvbpsi-devel

Kind regards,

Jean-Paul Saman
_______________________________________________
libdvbpsi-devel mailing list
[email protected]
http://mailman.videolan.org/listinfo/libdvbpsi-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.