[libdvbpsi-devel] descriptors/dr_50.c: Dereference null pointer (CID 17264)

Jean-Paul Saman git at videolan.org
Wed Apr 16 15:53:32 CEST 2014


libdvbpsi | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Fri Apr 11 15:42:04 2014 +0200| [2e5781e4f477ce22ebd597c3f9adbbf9579b028f] | committer: Jean-Paul Saman

descriptors/dr_50.c: Dereference null pointer (CID 17264)

The bug occurs due to a missing check for allocation failure of p_decoded->i_text.
Instead p_decoded is checked again.

> http://git.videolan.org/gitweb.cgi/libdvbpsi.git/?a=commit;h=2e5781e4f477ce22ebd597c3f9adbbf9579b028f
---

 src/descriptors/dr_50.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/descriptors/dr_50.c b/src/descriptors/dr_50.c
index f6321f9..a2e491c 100644
--- a/src/descriptors/dr_50.c
+++ b/src/descriptors/dr_50.c
@@ -71,7 +71,7 @@ dvbpsi_component_dr_t* dvbpsi_DecodeComponentDr(dvbpsi_descriptor_t * p_descript
     {
     	p_decoded->i_text_length = p_descriptor->i_length - 6;
     	p_decoded->i_text = calloc(p_decoded->i_text_length - 6, sizeof(uint8_t));
-        if (!p_decoded)
+        if (!p_decoded->i_text)
         {
         	free(p_decoded);
             return NULL;



More information about the libdvbpsi-devel mailing list