Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.2
openhpi
openhpi-2.x_array_out_of_bounds.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File openhpi-2.x_array_out_of_bounds.patch of Package openhpi
Index: plugins/snmp_bc/snmp_bc_discover.c =================================================================== --- plugins/snmp_bc/snmp_bc_discover.c (revision 7014) +++ plugins/snmp_bc/snmp_bc_discover.c (revision 7015) @@ -575,29 +575,26 @@ SaErrorT snmp_bc_add_ep(SaHpiRdrT *rdrptr, SaHpiEntityPathT *ep_add) { - int i; - - if ( !rdrptr || !ep_add) { - err("Invalid parameter."); - return(SA_ERR_HPI_INVALID_PARAMS); - } - - for (i=0; i<SAHPI_MAX_ENTITY_PATH; i++) { - ep_add->Entry[i+1].EntityLocation = - rdrptr->Entity.Entry[i].EntityLocation; - ep_add->Entry[i+1].EntityType = - rdrptr->Entity.Entry[i].EntityType; - if (rdrptr->Entity.Entry[i].EntityType == SAHPI_ENT_ROOT) break; - } + int i, j; + SaHpiEntityPathT ep_copy; - for (i=0; i<SAHPI_MAX_ENTITY_PATH; i++) { - rdrptr->Entity.Entry[i].EntityLocation = ep_add->Entry[i].EntityLocation; - rdrptr->Entity.Entry[i].EntityType = ep_add->Entry[i].EntityType; - if (ep_add->Entry[i].EntityType == SAHPI_ENT_ROOT) break; - } - - return(SA_OK); - + if ( !rdrptr || !ep_add) { + err("Invalid parameter."); + return(SA_ERR_HPI_INVALID_PARAMS); + } + for (i=0; i<SAHPI_MAX_ENTITY_PATH;++i) { + ep_copy.Entry[i] = rdrptr->Entity.Entry[i]; + if (ep_copy.Entry[i].EntityType == SAHPI_ENT_ROOT) break; + } + for (i=0; i<SAHPI_MAX_ENTITY_PATH;++i) { + if (ep_add->Entry[i].EntityType == SAHPI_ENT_ROOT) break; + rdrptr->Entity.Entry[i] = ep_add->Entry[i]; + } + for (j=0; i<SAHPI_MAX_ENTITY_PATH; ++i, ++j) { + rdrptr->Entity.Entry[i] = ep_copy.Entry[j]; + if (ep_copy.Entry[j].EntityType == SAHPI_ENT_ROOT) break; + } + return(SA_OK); } /**
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor