From 7609abaaf3658280be83470a07a9f0f8289aee17 Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Wed, 8 Feb 2017 00:07:01 +0100 Subject: [PATCH] libauth: fix potential null deref in auth_proxy Should fix CID 155820 --- sys/src/lib/auth/auth_proxy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/src/lib/auth/auth_proxy.c b/sys/src/lib/auth/auth_proxy.c index 3785293..3c75d81 100644 --- a/sys/src/lib/auth/auth_proxy.c +++ b/sys/src/lib/auth/auth_proxy.c @@ -199,6 +199,11 @@ auth_proxy(int fd, AuthGetkey *getkey, char *fmt, ...) p = vsmprint(fmt, arg); va_end(arg); + if(p == nil){ + werrstr("not enough memory: %r"); + return nil; + } + ai = nil; afd = open("/mnt/factotum/rpc", ORDWR); if(afd < 0){