libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 7a6a9d14a4aa0c745e2804a9fe4e876bbb624217
parent e724878002ace7dfbd53e4ecdc8093e16ef353fe
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Sun, 12 Sep 2021 19:16:32 +0300

postprocessor: minor optimization: do not process zero-length data

Diffstat:
Msrc/microhttpd/postprocessor.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c @@ -438,8 +438,11 @@ process_value (struct MHD_PostProcessor *pp, mhd_assert (xoff < sizeof (xbuf)); /* unescape */ xbuf[xoff] = '\0'; /* 0-terminate in preparation */ - MHD_unescape_plus (xbuf); - xoff = MHD_http_unescape (xbuf); + if (0 != xoff) + { + MHD_unescape_plus (xbuf); + xoff = MHD_http_unescape (xbuf); + } /* finally: call application! */ if (pp->must_ikvi || (0 != xoff) ) {