mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
dtlogin: Resolve some coverity issues, including those thought previously fixed
This commit is contained in:
parent
399c1e08c3
commit
e14e74231c
5 changed files with 15 additions and 11 deletions
|
@ -215,7 +215,7 @@ Account( struct display *d, char *user, char *line, pid_t pid,
|
|||
* Currently, an unlimited number of foreign displays can log in.
|
||||
*/
|
||||
|
||||
if (user) strncpy(u->ut_user, user, sizeof(u->ut_user));
|
||||
if (user) snprintf(u->ut_user, sizeof(u->ut_user), "%s", user);
|
||||
if (line) {
|
||||
#ifdef _AIX
|
||||
/*
|
||||
|
|
|
@ -409,6 +409,7 @@ GetResource( char *name, char *class, int valueType, char **valuep,
|
|||
char *type;
|
||||
XrmValue value;
|
||||
char *string, *new_string;
|
||||
char empty[] = "";
|
||||
char str_buf[50];
|
||||
int len;
|
||||
|
||||
|
@ -422,8 +423,13 @@ GetResource( char *name, char *class, int valueType, char **valuep,
|
|||
}
|
||||
else
|
||||
{
|
||||
if(default_value) {
|
||||
string = default_value;
|
||||
len = (string == NULL ? 0 : strlen (string));
|
||||
len = strlen (string);
|
||||
} else {
|
||||
string = empty;
|
||||
len = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Debug ("%s/%s value %*.*s\n", name, class, len, len, string);
|
||||
|
|
|
@ -754,11 +754,8 @@ LoadAltDtsResources(struct display *d)
|
|||
Debug("LoadAltDtsResources- cant access %s.\n", resources);
|
||||
Debug("\t %s. Falling back to C.\n", strerror(errno));
|
||||
|
||||
if (resources)
|
||||
{
|
||||
free (resources);
|
||||
resources = NULL;
|
||||
}
|
||||
|
||||
resources = _ExpandLang(dirname[j], "C");
|
||||
if (access (resources, R_OK) != 0)
|
||||
|
@ -2073,7 +2070,7 @@ RunGreeter( struct display *d, struct greet_info *greet,
|
|||
language = d->language;
|
||||
#endif /* ENABLE_DYNAMIC_LANGLIST */
|
||||
|
||||
if ( d->language && strlen(d->language) > 0 )
|
||||
if (env && d->language && strlen(d->language) > 0 )
|
||||
env = setLang(d, env, language);
|
||||
}
|
||||
|
||||
|
|
|
@ -383,7 +383,7 @@ userEnv(
|
|||
langlist = languageList;
|
||||
#endif /* ENABLE_DYNAMIC_LANGLIST */
|
||||
|
||||
if (d->language && strlen(d->language) > 0)
|
||||
if (env && d->language && strlen(d->language) > 0)
|
||||
env = setLang(d, env, langlist);
|
||||
|
||||
#if 0 /* setting LC_ALL can cause undesirable side effects -- bf@hp */
|
||||
|
|
|
@ -1557,7 +1557,8 @@ MakeGreeting( void )
|
|||
*/
|
||||
|
||||
|
||||
if ( strlen(greetInfo.labelString) == 0 ||
|
||||
if ( !greetInfo.labelString ||
|
||||
strlen(greetInfo.labelString) == 0 ||
|
||||
strcmp(greetInfo.labelString, "None") == 0 ||
|
||||
strcmp(greetInfo.labelString, "none") == 0 )
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue