@@ -7,8 +7,13 @@ * copy passwords to the clipboard. it does * this by attempting to execute a sequence * of binaries, and then writing the password * to STDIN of the binary that succeeds. + * - D_SAVEKEY enables kpw to store the database + * key in persistent memory between invocations, + * leading to quicker decryption and access + * times. only available on systems with SYSV + * shared memory. * ? generates passwords * → kpw is unlikely to be portable to non-POSIX * systems, but should run fine on Linux as well * as BSDs with getrandom() support. @@ -810,9 +815,9 @@ bad d; if((d = dbnext(db, &rec, ctlen, pub, priv, ctbuf, ptbuf)) != ok) return d; - if(strncmp(target, rec.acct.ptr, rec.acct.len) == 0) { + if(strlen(target) == rec.acct.len && strncmp(target, rec.acct.ptr, rec.acct.len) == 0) { /* found a matching record; determine * what to do to the fucker */ alert(a_debug, "found target record"); found = true;