]> git.sesse.net Git - vlc/commit
stream_out: rtp: don't use VLA for user controlled data
authorFabian Yamaguchi <fyamagu@gwdg.de>
Fri, 5 Dec 2014 12:58:24 +0000 (13:58 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 10 Dec 2014 20:32:27 +0000 (21:32 +0100)
commit204291467724867b79735c0ee3aeb0dbc2200f97
tree5ec2122f0e5495826725428a9460ca45dd2daf25
parentfbe2837bc80f155c001781041a54c58b5524fc14
stream_out: rtp: don't use VLA for user controlled data

It should fix a possible invalid memory access

When streaming ogg-files via rtp, an ogg-file can trigger an invalid
write access using an overly long 'configuration' string.

The original code attemps to allocate space to hold the string on the stack
and hence, cannot verify if allocation succeeds. Instead, we now allocate the
buffer on the heap and return if allocation fails.

In detail, rtp_packetize_xiph_config allocates a buffer on the stack at (1) where
the size depends on the local variable 'len'. The variable 'len' is
calculated at (0) to be the length of a string contained in a specially
crafted Ogg Vorbis file, and therefore, it is attacker-controlled.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/stream_out/rtpfmt.c