From 91a8d03040a3533e27f51d33bbbfed33d84b5043 Mon Sep 17 00:00:00 2001 From: qwx Date: Mon, 26 Aug 2019 17:02:58 +0200 Subject: vncv: fix snarf buffer realloc memory corruption fix never updating p when snarf is reallocated, resulting in memory corruption. --- sys/src/cmd/vnc/wsys.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/src/cmd/vnc') diff --git a/sys/src/cmd/vnc/wsys.c b/sys/src/cmd/vnc/wsys.c index 81ffb39d9..d4b13b655 100644 --- a/sys/src/cmd/vnc/wsys.c +++ b/sys/src/cmd/vnc/wsys.c @@ -281,6 +281,7 @@ getsnarf(int *sz) *sz += c; if (n == 0){ snarf = realloc(snarf, *sz + 8192); + p = snarf + *sz; n = 8192; } } -- cgit v1.2.3