dr_76.c: Fix (CID 17267) out-of-bounds write.
[email protected] (Jean-Paul Saman) Wed, 16 Apr 2014 15:53:31 +0200 (CEST)
| Newsgroups | gmane.comp.video.videolan.libdvbpsi.devel |
|---|---|
| Message-ID | <[email protected]> |
libdvbpsi | branch: master | Jean-Paul Saman <[email protected]> | Fri Apr 11 14:44:11 2014 +0200| [3fb4b208c78701d2ed29f1d4db79a9ae5af35c33] | committer: Jean-Paul Saman dr_76.c: Fix (CID 17267) out-of-bounds write. > http://git.videolan.org/gitweb.cgi/libdvbpsi.git/?a=commit;h=3fb4b208c78701d2ed29f1d4db79a9ae5af35c33 --- src/descriptors/dr_76.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/descriptors/dr_76.c b/src/descriptors/dr_76.c index 7089488..b32ee31 100644 --- a/src/descriptors/dr_76.c +++ b/src/descriptors/dr_76.c @@ -87,7 +87,9 @@ dvbpsi_content_id_dr_t *dvbpsi_DecodeContentIdDr(dvbpsi_descriptor_t *p_descript entry->value.path[i] = p_descriptor->p_data[byte + i]; } byte += len; - entry->value.path[i] = 0; + /* Properly terminate the string */ + unsigned int last = (i < len) ? i : len - 1U; + entry->value.path[last] = 0; } else if (entry->i_location == CRID_LOCATION_CIT) { _______________________________________________ libdvbpsi-devel mailing list [email protected] https://mailman.videolan.org/listinfo/libdvbpsi-devel