[vlc-devel] [PATCH] demux: ts: fix debug message of non-terminated string

Hannes Domani ssbssa at yahoo.de
Fri Apr 29 18:18:29 CEST 2016


---
 modules/demux/mpeg/ts_psi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mpeg/ts_psi.c b/modules/demux/mpeg/ts_psi.c
index 21ab59c..026f80d 100644
--- a/modules/demux/mpeg/ts_psi.c
+++ b/modules/demux/mpeg/ts_psi.c
@@ -221,8 +221,11 @@ static void ParsePMTRegistrations( demux_t *p_demux, const dvbpsi_descriptor_t
                 {
                     if( !memcmp( regs[i].rgs, p_dr->p_data, 4 ) )
                     {
+                        char reg[5];
+                        memcpy( reg, p_dr->p_data, 4 );
+                        reg[4] = 0;
                         registration_type = regs[i].reg;
-                        msg_Dbg( p_demux, PMT_DESC_INDENT "%4.4s registration", p_dr->p_data );
+                        msg_Dbg( p_demux, PMT_DESC_INDENT "%4.4s registration", reg );
                         break;
                     }
                 }
-- 
2.8.1



More information about the vlc-devel mailing list