Skip to content

Commit

Permalink
[syncd] Fix crash during stats polling (#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
vsenchyshyn authored Apr 1, 2020
1 parent d13521e commit 91792db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion syncd/Syncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ sai_status_t Syncd::processGetStatsEvent(
counter_ids.push_back(val);
}

std::vector<uint64_t> result;
std::vector<uint64_t> result(counter_ids.size());

auto status = m_vendorSai->getStats(
metaKey.objecttype,
Expand Down
6 changes: 6 additions & 0 deletions syncd/VendorSai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,12 @@ sai_status_t VendorSai::getStats(
_In_ const sai_stat_id_t *counter_ids,
_Out_ uint64_t *counters);

if (!counter_ids || !counters)
{
SWSS_LOG_ERROR("NULL pointer function argument");
return SAI_STATUS_INVALID_PARAMETER;
}

switch ((int)object_type)
{
case SAI_OBJECT_TYPE_PORT:
Expand Down

0 comments on commit 91792db

Please sign in to comment.