aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-02-04 13:07:04 +0100
committerPierre Ossman <ossman@cendio.se>2023-02-04 14:03:13 +0100
commitcee09051e685e952b948cafab2d4ccdb9ab11f07 (patch)
tree55207f3bb62dd43f1e200cd656f61a3b8139ee90 /common/rfb
parentcf931f8c9a677161bde70859799f1ad4f3470fbc (diff)
downloadtigervnc-cee09051e685e952b948cafab2d4ccdb9ab11f07.tar.gz
tigervnc-cee09051e685e952b948cafab2d4ccdb9ab11f07.zip
Make sure length is reset on assignment
Otherwise the old length is preserved, which will result in NULL pointer dereferencing if the parameter is ever accessed.
Diffstat (limited to 'common/rfb')
-rw-r--r--common/rfb/Configuration.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/rfb/Configuration.cxx b/common/rfb/Configuration.cxx
index c2f59d86..4b376168 100644
--- a/common/rfb/Configuration.cxx
+++ b/common/rfb/Configuration.cxx
@@ -456,7 +456,9 @@ void BinaryParameter::setParam(const uint8_t* v, size_t len) {
LOCK_CONFIG;
if (immutable) return;
vlog.debug("set %s(Binary)", getName());
- delete [] value; value = 0;
+ delete [] value;
+ value = NULL;
+ length = 0;
if (len) {
assert(v);
value = new uint8_t[len];