Skip to content

Commit

Permalink
Merge pull request #2734 from open-hpi/2723_coverty_scan
Browse files Browse the repository at this point in the history
Fix for #2723 Coverity Scan detects several issues in 3.8.0
  • Loading branch information
mohandev2 authored Sep 5, 2018
2 parents 098a5ff + 63aa422 commit 103616c
Show file tree
Hide file tree
Showing 10 changed files with 183 additions and 180 deletions.
4 changes: 3 additions & 1 deletion plugins/ilo2_ribcl/ilo2_ribcl_xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -3297,7 +3297,9 @@ static int ir_xml_iml_write( struct oh_handler_state *oh_handler,
class = xmlGetProp( n, (const xmlChar *)"CLASS");
last_update = xmlGetProp( n, (const xmlChar *)"LAST_UPDATE");
time = (struct tm){0,0,0,0,0,0,0,0,-1};
strptime((const char*) last_update,"%m/%d/%Y %H:%M", &time);
if ( last_update )
strptime((const char*) last_update,"%m/%d/%Y %H:%M",
&time);
seconds = mktime( &time) * 1000000000LL;
if( seconds > ir_handler->iml_log_time)
{
Expand Down
4 changes: 2 additions & 2 deletions plugins/ipmidirect/ipmi_con_smi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ cIpmiConSmi::IfOpen()
/* Some sensors take longer than 1 sec, use driver default. ARCress */
// rv = ioctl( fd, IPMICTL_SET_TIMING_PARMS_CMD, &parms );

if ( rv == -1 )
stdlog << "Warning: Could not set timing parms !\n";
// if ( rv == -1 )
// stdlog << "Warning: Could not set timing parms !\n";

// we want async events
int val = 1;
Expand Down
12 changes: 3 additions & 9 deletions plugins/ov_rest/ov_rest_callsupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,9 @@ SaErrorT ov_rest_curl_get_request(REST_CON *connection,
chunk = curl_slist_append(chunk, SessionId);
wrap_free(Auth);
wrap_free(SessionId);
if(connection->xAuthToken != NULL){
WRAP_ASPRINTF(&X_Auth_Token,OV_REST_X_AUTH_TOKEN,
connection->xAuthToken);
chunk = curl_slist_append(chunk, X_Auth_Token);
}else {
err("Sessionkey for server single sign on is invalid/NULL");
curl_slist_free_all(chunk);
return SA_ERR_HPI_INVALID_SESSION;
}
WRAP_ASPRINTF(&X_Auth_Token,OV_REST_X_AUTH_TOKEN,
connection->xAuthToken);
chunk = curl_slist_append(chunk, X_Auth_Token);
wrap_free(X_Auth_Token);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 60L);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
Expand Down
2 changes: 1 addition & 1 deletion plugins/ov_rest/ov_rest_composer_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ SaErrorT ov_rest_proc_composer_insertion_event(
}
ov_rest_json_parse_applianceInfo(jvalue_cim, &response);
/* Make call to the ha-node */
if(!response.serialNumber || !strcmp(response.serialNumber, "")){
if(!strcmp(response.serialNumber, "")){
CRIT("serial number is NULL in appliance bay %d .\n"
"Please Restart the Openhpid.", bayNumber);
return SA_ERR_HPI_INVALID_DATA;
Expand Down
Loading

0 comments on commit 103616c

Please sign in to comment.