mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
kauth: Handle calls to ka_log with no principal
If ka_log is called without a principal string, then the resulting buffer will be garbage, as we don't start with a string for strlcat to append to. Caught by coverity (#985959) Reviewed-on: http://gerrit.openafs.org/9396 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com> (cherry picked from commit 508674486a5b1b3b25d7f28febb41e8712d8592d) Change-Id: Ib65f63a1a7adef73d56d61ea59adfbca430dff13 Reviewed-on: http://gerrit.openafs.org/11045 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
This commit is contained in:
parent
99795bac24
commit
43b80fee3d
@ -137,6 +137,8 @@ ka_log(char *principal, char *instance, char *sprincipal, char *sinstance,
|
|||||||
{
|
{
|
||||||
char logbuf[512]; /* not random! 63 . 63 , 63 . 63 max key */
|
char logbuf[512]; /* not random! 63 . 63 , 63 . 63 max key */
|
||||||
|
|
||||||
|
logbuf[0] = '\0'; /* Empty string */
|
||||||
|
|
||||||
if (*principal)
|
if (*principal)
|
||||||
strcpy(logbuf, principal);
|
strcpy(logbuf, principal);
|
||||||
if (realm) {
|
if (realm) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user