uhttpd URL-codec bug fixes.
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 3 May 2012 17:19:16 +0000 (17:19 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 3 May 2012 17:19:16 +0000 (17:19 +0000)
commit5264d48e814fd0cdece39ea87009a7217272b73d
tree088d1a4973acf821193f1849bd4b23b0dbb4563a
parented4326a2648e092647fd7003ebcf1d5b4c91b63a
uhttpd URL-codec bug fixes.

* Fixed output-buffer-overflow bug in uh_urlencode() and uh_urldecode() [tested
  input-buffer index against output-buffer length].  In reality, this would not
  typically cause an overflow on decode, where the output string would be
  expected to be shorter than the input string; and uh_urlencode() seems to have
  been unreferenced in the source.

* Fixed bug: uh_urlencode() and uh_urldecode() both read one extra byte from the
  input-string.  While this could manifest in C code, the result was most
  egregious when called from Lua, where it caused an extra null byte to be
  embedded at the end of the output string.

* uh_urlencode() cleanup: removed redundant bitwise-and.

Signed-off-by: David Favro <openwrt@meta-dynamic.com>
SVN-Revision: 31569
package/uhttpd/src/uhttpd-utils.c