plan9port

[fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port # fast
git clone https://src.adamsgaard.dk/plan9port.git # slow
Log | Files | Refs | README | LICENSE Back to index

commit e80159c932a9f8728a7e8adf6a79282dec98a61d
parent aac05c40926da9a9742e4eaaa1b02ea77539e223
Author: David du Colombier <0intro@gmail.com>
Date:   Wed,  7 Dec 2011 12:27:07 -0500

aescbc: fix segfault on backspace

R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/5440107

Diffstat:
Msrc/cmd/auth/secstore/aescbc.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/cmd/auth/secstore/aescbc.c b/src/cmd/auth/secstore/aescbc.c @@ -1,8 +1,9 @@ -/* encrypt file by writing +/* +encrypt file by writing v2hdr, 16byte initialization vector, AES-CBC(key, random | file), - HMAC_SHA1(md5(key), AES-CBC(random | file)) +HMAC_SHA1(md5(key), AES-CBC(random | file)) */ #include <u.h> #include <libc.h> @@ -91,6 +92,8 @@ main(int argc, char **argv) buf[--n] = 0; }else{ pass = readcons("aescbc password", nil, 1); + if(pass == nil) + exits("readcons"); n = strlen(pass); if(n >= BUF) exits("key too long");