Skip to content

Commit

Permalink
[glass] Check for struct descriptor size 0 (wpilibsuite#7192)
Browse files Browse the repository at this point in the history
This avoids a potential divide by 0.
  • Loading branch information
PeterJohnson authored and katzuv committed Oct 14, 2024
1 parent 21ad2e4 commit 0603359
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion glass/src/libnt/native/cpp/NetworkTables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ void NetworkTablesModel::ValueSource::UpdateFromValue(
structName = *withoutArray;
}
auto desc = model.m_structDb.Find(structName);
if (desc && desc->IsValid()) {
if (desc && desc->IsValid() && desc->GetSize() != 0) {
if (isArray) {
// array of struct at top level
if (valueChildrenMap) {
Expand Down

0 comments on commit 0603359

Please sign in to comment.