Date: Mon, 29 Apr 2013 23:08:13 +0000 (UTC) From: "Justin T. Gibbs" <gibbs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250081 - head/sys/xen/xenstore Message-ID: <201304292308.r3TN8Dlj034100@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gibbs Date: Mon Apr 29 23:08:13 2013 New Revision: 250081 URL: http://svnweb.freebsd.org/changeset/base/250081 Log: xenstore/xenstore.c: Prevent access to invalid memory region when listing an empty directory in the XenStore. Reported by: Bei Guan MFC after: 1 week Modified: head/sys/xen/xenstore/xenstore.c Modified: head/sys/xen/xenstore/xenstore.c ============================================================================== --- head/sys/xen/xenstore/xenstore.c Mon Apr 29 22:54:26 2013 (r250080) +++ head/sys/xen/xenstore/xenstore.c Mon Apr 29 23:08:13 2013 (r250081) @@ -307,7 +307,8 @@ split(char *strings, u_int len, u_int *n const char **ret; /* Protect against unterminated buffers. */ - strings[len - 1] = '\0'; + if (len > 0) + strings[len - 1] = '\0'; /* Count the strings. */ *num = extract_strings(strings, /*dest*/NULL, len);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304292308.r3TN8Dlj034100>