]> source.dussan.org Git - tigervnc.git/commitdiff
Avoid potential crash when replacing buffer in PlainPasswd 728/head
authorJan Grulich <jgrulich@redhat.com>
Mon, 1 Oct 2018 08:17:20 +0000 (10:17 +0200)
committerJan Grulich <jgrulich@redhat.com>
Wed, 3 Oct 2018 07:59:41 +0000 (09:59 +0200)
common/rfb/util.h

index b678b89025b92c2cdf96325f6a9674222b4a6c4b..9e59bd378f7048b2e5dd041a36e44a660d104ac4 100644 (file)
@@ -50,7 +50,7 @@ namespace rfb {
     CharArray() : buf(0) {}
     CharArray(char* str) : buf(str) {} // note: assumes ownership
     CharArray(int len) {
-      buf = new char[len];
+      buf = new char[len]();
     }
     ~CharArray() {
       delete [] buf;