When building tcell_l in kerberosSuperUser, make sure that we
don't overflow the string that we're constructing.
Use the opr_lcstring function to do the lower case conversion,
rather than rolling our own.
Caught by coverity (#985772)
Change-Id: I6e28cfc54883aac7e3a3eb2f4e2b2bf7ebc0bc63
Reviewed-on: http://gerrit.openafs.org/9544
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
char *tcell, struct rx_identity **identity)
{
char tcell_l[MAXKTCREALMLEN] = "";
- char *tmp;
int code;
afs_int32 islocal;
int flag;
/* generate lowercased version of cell name */
- if (tcell) {
- strcpy(tcell_l, tcell);
- tmp = tcell_l;
- while (*tmp) {
- *tmp = tolower(*tmp);
- tmp++;
- }
- }
+ if (tcell)
+ opr_lcstring(tcell_l, tcell, sizeof(tcell_l));
code = afsconf_IsLocalRealmMatch(adir, &islocal, tname, tinst, tcell);
if (code) {