diff options
| author | Theodore Tso <tytso@mit.edu> | 1992-08-20 01:30:33 +0000 |
|---|---|---|
| committer | Theodore Tso <tytso@mit.edu> | 1992-08-20 01:30:33 +0000 |
| commit | 0be9bdba5d41c5530eda0ef9ef551c8d5309131b (patch) | |
| tree | dfe1df9848d7e4ef34afb0074154968f56b6d80c /src/lib | |
| parent | c626c7db62289b5ac143a7acc6b20c6b63c38d1b (diff) | |
| download | krb5-0be9bdba5d41c5530eda0ef9ef551c8d5309131b.tar.gz krb5-0be9bdba5d41c5530eda0ef9ef551c8d5309131b.tar.xz krb5-0be9bdba5d41c5530eda0ef9ef551c8d5309131b.zip | |
Changed so that the krb5_data structures (in the principal structure)
have nulls at the end of the strings, just in case poeple are depending
on it. They shouldn't, since principals component may have embedded
NULL's in them, even though they usually don't. Nevertheless, it's good
to be careful.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2334 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/krb5/ccache/file/fcc_read.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/krb5/ccache/file/fcc_read.c b/src/lib/krb5/ccache/file/fcc_read.c index e59e8c82a..b41ce1b9b 100644 --- a/src/lib/krb5/ccache/file/fcc_read.c +++ b/src/lib/krb5/ccache/file/fcc_read.c @@ -228,7 +228,7 @@ krb5_fcc_read_data(id, data) return KRB5_OK; } - data->data = (char *) malloc(data->length); + data->data = (char *) malloc(data->length+1); if (data->data == NULL) return KRB5_CC_NOMEM; @@ -242,11 +242,8 @@ krb5_fcc_read_data(id, data) xfree(data->data); return KRB5_CC_END; } + data->data[data->length] = 0; /* Null terminate, just in case.... */ return KRB5_OK; - errout: - if (data->data) - xfree(data->data); - return kret; } krb5_error_code |
