YFS Coverity 11738

Change-Id: I553c310afbefb50521d90e0aa7121cae359ee311
This commit is contained in:
Jeffrey Altman
2015-04-21 21:47:48 -04:00
parent bcb92ceaa7
commit afd946149f

View File

@@ -41,7 +41,7 @@ extern int local_flag;
int int
stash(struct stash_options *opt, int argc, char **argv) stash(struct stash_options *opt, int argc, char **argv)
{ {
char buf[1024]; char buf[1024+1];
krb5_error_code ret; krb5_error_code ret;
krb5_enctype enctype; krb5_enctype enctype;
hdb_master_key mkey; hdb_master_key mkey;
@@ -85,7 +85,7 @@ stash(struct stash_options *opt, int argc, char **argv)
salt.saltvalue.length = 0; salt.saltvalue.length = 0;
if(opt->master_key_fd_integer != -1) { if(opt->master_key_fd_integer != -1) {
ssize_t n; ssize_t n;
n = read(opt->master_key_fd_integer, buf, sizeof(buf)); n = read(opt->master_key_fd_integer, buf, sizeof(buf)-1);
if(n == 0) if(n == 0)
krb5_warnx(context, "end of file reading passphrase"); krb5_warnx(context, "end of file reading passphrase");
else if(n < 0) { else if(n < 0) {