-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle empty table when writing NanoAOD #37693
Conversation
Avoid dereferencing a null pointer when writing an empty table. This was uncovered by the UBSAN checks.
@@ -54,7 +54,9 @@ class TableOutputBranches { | |||
int idx = tab.columnIndex(pair.name); | |||
if (idx == -1) | |||
throw cms::Exception("LogicError", "Missing column in input for " + m_baseName + "_" + pair.name); | |||
pair.branch->SetAddress(const_cast<T *>(&tab.columnData<T>(idx).front())); // SetAddress should take a const * ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
front()
returns a reference and should never be called if the container is empty.
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37693/29515
|
A new Pull Request was created by @Dr15Jones (Chris Jones) for master. It involves the following packages:
@cmsbuild, @mariadalfonso, @gouskos, @fgolf can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-5f57b7/24244/summary.html Comparison Summary@slava77 comparisons for the following workflows were not done due to missing matrix map:
Summary:
|
+xpog technical PR |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
Avoid dereferencing a null pointer when writing an empty table.
This was uncovered by the UBSAN checks.
PR validation:
Code compiles.