summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/9/port/devssl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/src/9/port/devssl.c b/sys/src/9/port/devssl.c
index 249003ca3..52c0c2309 100644
--- a/sys/src/9/port/devssl.c
+++ b/sys/src/9/port/devssl.c
@@ -1186,12 +1186,20 @@ sslwrite(Chan *c, void *a, long n, vlong)
m = (strlen(p)*3)/2;
x = smalloc(m);
t = dec64(x, m, p, strlen(p));
+ if(t <= 0){
+ free(x);
+ error(Ebadarg);
+ }
setsecret(&s->in, x, t);
free(x);
} else if(strcmp(buf, "secretout") == 0 && p != 0) {
m = (strlen(p)*3)/2 + 1;
x = smalloc(m);
t = dec64(x, m, p, strlen(p));
+ if(t <= 0){
+ free(x);
+ error(Ebadarg);
+ }
setsecret(&s->out, x, t);
free(x);
} else