]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
cgi: Fix showing query string in Help
authorzdohnal <zdohnal@redhat.com>
Mon, 10 Jun 2024 06:27:04 +0000 (08:27 +0200)
committerGitHub <noreply@github.com>
Mon, 10 Jun 2024 06:27:04 +0000 (08:27 +0200)
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.


Trivial merge