mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtinfo: fix coverity issues related to null checks after dereference
This commit is contained in:
parent
2b15c4057e
commit
bc28c20524
6 changed files with 24 additions and 22 deletions
|
@ -70,29 +70,33 @@ base::base(object_dict* obj_dict,
|
||||||
num_cset_ptrs(0), num_list_ptrs(0),
|
num_cset_ptrs(0), num_list_ptrs(0),
|
||||||
f_obj_dict(obj_dict)
|
f_obj_dict(obj_dict)
|
||||||
{
|
{
|
||||||
int len = MIN(strlen(base_dir), PATHSIZ - 1);
|
if ( base_dir ) {
|
||||||
if ( base_dir )
|
int len = MIN(strlen(base_dir), PATHSIZ - 1);
|
||||||
*((char *) memcpy (base_path, base_dir, len) + len) = '\0';
|
*((char *) memcpy (base_path, base_dir, len) + len) = '\0';
|
||||||
else
|
} else {
|
||||||
base_path[0] = 0;
|
base_path[0] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
len = MIN(strlen(base_nm), PATHSIZ - 1);
|
if ( base_nm ) {
|
||||||
if ( base_nm )
|
int len = MIN(strlen(base_nm), PATHSIZ - 1);
|
||||||
*((char *) memcpy (base_name, base_nm, len) + len) = '\0';
|
*((char *) memcpy (base_name, base_nm, len) + len) = '\0';
|
||||||
else
|
} else {
|
||||||
base_name[0] = 0;
|
base_name[0] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
len = MIN(strlen(base_ds), PATHSIZ - 1);
|
if ( base_ds ) {
|
||||||
if ( base_ds )
|
int len = MIN(strlen(base_ds), PATHSIZ - 1);
|
||||||
*((char *) memcpy (base_desc, base_ds, len) + len) = '\0';
|
*((char *) memcpy (base_desc, base_ds, len) + len) = '\0';
|
||||||
else
|
} else {
|
||||||
base_desc[0] = 0;
|
base_desc[0] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
len = MIN(strlen(base_uid_str), UIDSIZ - 1);
|
if ( base_uid_str ) {
|
||||||
if ( base_uid_str )
|
int len = MIN(strlen(base_uid_str), UIDSIZ - 1);
|
||||||
*((char *) memcpy (base_uid, base_uid_str, len) + len) = '\0';
|
*((char *) memcpy (base_uid, base_uid_str, len) + len) = '\0';
|
||||||
else
|
} else {
|
||||||
base_uid[0] = 0;
|
base_uid[0] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ( set_nms )
|
if ( set_nms )
|
||||||
while ( info_base_set_names[num_cset_ptrs] )
|
while ( info_base_set_names[num_cset_ptrs] )
|
||||||
|
|
|
@ -72,11 +72,12 @@ debug(cerr, base_dir);
|
||||||
debug(cerr, base_nm);
|
debug(cerr, base_nm);
|
||||||
debug(cerr, base_ds);
|
debug(cerr, base_ds);
|
||||||
*/
|
*/
|
||||||
int len = MIN(strlen(base_locale), PATHSIZ - 1);
|
if (base_locale) {
|
||||||
if (base_locale)
|
int len = MIN(strlen(base_locale), PATHSIZ - 1);
|
||||||
*((char *) memcpy (info_base_locale, base_locale, len) + len) = '\0';
|
*((char *) memcpy (info_base_locale, base_locale, len) + len) = '\0';
|
||||||
else
|
} else {
|
||||||
*info_base_locale = 0;
|
*info_base_locale = 0;
|
||||||
|
}
|
||||||
|
|
||||||
char* nm ;
|
char* nm ;
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -530,8 +530,7 @@ highlight_search_hit(_DtCvSegment* seg, unsigned int vcc, unsigned int len)
|
||||||
}
|
}
|
||||||
DtCvStrVcLenSync(seg);
|
DtCvStrVcLenSync(seg);
|
||||||
|
|
||||||
if (sibling->handle.string.string)
|
free (sibling->handle.string.string);
|
||||||
free (sibling->handle.string.string);
|
|
||||||
if (sibling->client_use) {
|
if (sibling->client_use) {
|
||||||
delete (SegClientData*)sibling->client_use;
|
delete (SegClientData*)sibling->client_use;
|
||||||
sibling->client_use = NULL;
|
sibling->client_use = NULL;
|
||||||
|
|
|
@ -129,8 +129,7 @@ build_bc_url(UAS_String bookcase_path)
|
||||||
fprintf(stderr, "(DEBUG) URL=\"%s\"\n", (char*)bc_locator);
|
fprintf(stderr, "(DEBUG) URL=\"%s\"\n", (char*)bc_locator);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (bc_path)
|
free(bc_path);
|
||||||
free(bc_path);
|
|
||||||
|
|
||||||
return bc_locator;
|
return bc_locator;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ AusText::~AusText()
|
||||||
{
|
{
|
||||||
store->deActivateZone ( f_base );
|
store->deActivateZone ( f_base );
|
||||||
|
|
||||||
if ( store ) { delete store; }
|
delete store;
|
||||||
if ( f_search_store ) { delete f_search_store; }
|
if ( f_search_store ) { delete f_search_store; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -828,8 +828,7 @@ makeAbsPathEnv(char *var)
|
||||||
snprintf(newVar, pathlen, "%s=%s", var, newPath);
|
snprintf(newVar, pathlen, "%s=%s", var, newPath);
|
||||||
putenv(newVar);
|
putenv(newVar);
|
||||||
|
|
||||||
if (newPath)
|
XtFree(newPath);
|
||||||
XtFree(newPath);
|
|
||||||
|
|
||||||
return newVar;
|
return newVar;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue