~videolan/vlc/vlc-2.1

Viewing all changes in revision 54587.

  • Committer: Jean-Baptiste Kempf
  • Author(s): Fabian Yamaguchi
  • Date: 2015-01-22 13:40:20 UTC
  • Revision ID: jb@videolan.org-20150122134020-fj35foeyeot2oocq
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>
(cherry picked from commit 204291467724867b79735c0ee3aeb0dbc2200f97)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>

Conflicts:
        modules/stream_out/rtpfmt.c

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: