From: zdohnal Date: Mon, 10 Jun 2024 06:27:04 +0000 (+0200) Subject: cgi: Fix showing query string in Help X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e388c3f45741638bc64adf3d9cf88457425ee9a;p=thirdparty%2Fcups.git cgi: Fix showing query string in Help If a string was searched on CUPS Web UI help page, garbage was printed out in search box. It was because text field pointer was freed before and contained garbage - previously it was variable value which was allocated, so the string survived cgCleanVariables((), but the text field is a pointer into form variables which gets cleaned up. Fix is to use strdup() if cgiGetTextfield() returns non-NULL pointer. The binary exits shortly after either way, so memory is taken care of by OS. --- 7e388c3f45741638bc64adf3d9cf88457425ee9a