OSDN Git Service

Properly terminate parsed environment values with '\0'.
authorTobias Stoeckmann <tobias@stoeckmann.org>
Sat, 25 Jun 2016 18:08:31 +0000 (20:08 +0200)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 1 Aug 2016 02:58:39 +0000 (10:58 +0800)
commit1517fd276e12cac14c018d5a30792177eb6c59de
tree0a7cfe2fd2b21bab662df73fa244b33692178e07
parentdef5691f789b897b47af7f2a7ffa3b135a93950d
Properly terminate parsed environment values with '\0'.

The function strncpy() does not guarantee to nul terminate the
destination. In most cases, this cannot be triggered, but it is also
used to parse user environment variables. These are allowed to be longer
than 1023 characters, effectively resulting in an unterminated string.

I've adjusted other places as well, because it won't hurt.

https://bugs.freedesktop.org/show_bug.cgi?id=96677
va/va.c
va/va_trace.c