configure.ac |    2 +-
 src/XvMC.c   |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 44a462835cbe263451a463af17f0fbedc1c957b2
Author: Matthieu Herrb <[email protected]>
Date:   Tue Oct 4 22:09:12 2016 +0200

    libXvMC 1.0.10
    
    Signed-off-by: Matthieu Herrb <[email protected]>

diff --git a/configure.ac b/configure.ac
index 01f286f..c0b87c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@
 
 # Initialize Autoconf
 AC_PREREQ([2.60])
-AC_INIT([libXvMC], [1.0.9],
+AC_INIT([libXvMC], [1.0.10],
        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXvMC])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])

commit 2cd95e7da8367cccdcdd5c9b160012d1dec5cbdb
Author: Tobias Stoeckmann <[email protected]>
Date:   Sun Sep 25 22:34:27 2016 +0200

    Avoid buffer underflow on empty strings.
    
    If an empty string is received from an x-server, do not underrun the
    buffer by accessing "rep.nameLen - 1" unconditionally, which could end
    up being -1.
    
    Signed-off-by: Tobias Stoeckmann <[email protected]>
    Reviewed-by: Matthieu Herrb <[email protected]>

diff --git a/src/XvMC.c b/src/XvMC.c
index 7336760..3ee4212 100644
--- a/src/XvMC.c
+++ b/src/XvMC.c
@@ -576,9 +576,9 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port,
        if (*name && *busID && tmpBuf) {
            _XRead(dpy, tmpBuf, realSize);
            strncpy(*name,tmpBuf,rep.nameLen);
-           (*name)[rep.nameLen - 1] = '\0';
+           (*name)[rep.nameLen == 0 ? 0 : rep.nameLen - 1] = '\0';
            strncpy(*busID,tmpBuf+rep.nameLen,rep.busIDLen);
-           (*busID)[rep.busIDLen - 1] = '\0';
+           (*busID)[rep.busIDLen == 0 ? 0 : rep.busIDLen - 1] = '\0';
            XFree(tmpBuf);
        } else {
            XFree(*name);

Reply via email to