Stefan Hajnoczi b7052cd7bc sunrpc/cache: fix off-by-one in qword_get()
The qword_get() function NUL-terminates its output buffer.  If the input
string is in hex format \xXXXX... and the same length as the output
buffer, there is an off-by-one:

  int qword_get(char **bpp, char *dest, int bufsize)
  {
      ...
      while (len < bufsize) {
          ...
          *dest++ = (h << 4) | l;
          len++;
      }
      ...
      *dest = '\0';
      return len;
  }

This patch ensures the NUL terminator doesn't fall outside the output
buffer.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2016-02-23 13:20:16 -05:00
..
2014-07-12 18:45:49 -04:00
2014-11-24 17:31:46 -05:00
2014-11-24 17:31:46 -05:00
2015-07-02 11:32:23 -07:00
2016-01-22 18:04:28 -05:00
2014-06-11 15:46:13 -07:00
2015-02-03 11:06:38 -08:00
2015-12-07 13:04:59 -08:00
2012-04-15 12:44:40 -04:00
2016-01-07 18:45:36 -05:00