Conversation
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
There was a problem hiding this comment.
1 issue found across 38 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/utils.h">
<violation number="1" location="src/utils.h:186">
P2: Checking `annotation.is_null()` drops valid `null` annotation values from trace output; use the entry type to decide whether to print annotation details.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| stream << " (" << entry.name << ")\n"; | ||
|
|
||
| if (entry.annotation.has_value()) { | ||
| if (!entry.annotation.is_null()) { |
There was a problem hiding this comment.
P2: Checking annotation.is_null() drops valid null annotation values from trace output; use the entry type to decide whether to print annotation details.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/utils.h, line 186:
<comment>Checking `annotation.is_null()` drops valid `null` annotation values from trace output; use the entry type to decide whether to print annotation details.</comment>
<file context>
@@ -175,13 +183,13 @@ inline auto print(const sourcemeta::blaze::TraceOutput &output,
stream << " (" << entry.name << ")\n";
- if (entry.annotation.has_value()) {
+ if (!entry.annotation.is_null()) {
stream << " value ";
</file context>
| if (!entry.annotation.is_null()) { | |
| if (entry.type == sourcemeta::blaze::TraceOutput::EntryType::Annotation) { |
🤖 Augment PR SummarySummary: Updates vendored Blaze/Core to newer commits, bringing evaluator/output refactors plus new Core utilities. Changes:
Technical Notes: Trace-mode output is now emitted during evaluation via a callback, changing how callers stream/format trace entries. 🤖 Was this summary useful? React with 👍 or 👎 |
| .vocabulary = vocabulary}; | ||
| this->callback_(entry); | ||
| } else { | ||
| auto effective_evaluate_path{evaluate_path.resolve_from(this->base_)}; |
There was a problem hiding this comment.
TraceOutput::Entry stores evaluate_path by reference, but in this branch it binds to the local effective_evaluate_path; if a callback stores the Entry (or takes references to its fields) it can dangle immediately after operator() returns. This looks like a potential UAF footgun unless the API explicitly guarantees entries never escape the callback.
Severity: medium
Other Locations
vendor/blaze/src/output/include/sourcemeta/blaze/output_trace.h:66
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| stream << " (" << entry.name << ")\n"; | ||
|
|
||
| if (entry.annotation.has_value()) { | ||
| if (!entry.annotation.is_null()) { |
There was a problem hiding this comment.
| this->cursor_ += length; | ||
| } | ||
|
|
||
| [[nodiscard]] SOURCEMETA_FORCEINLINE inline auto str() |
There was a problem hiding this comment.
After HTMLBuffer::str() runs, cursor_ becomes null, so later append() calls will restart writing at the beginning of buffer_ (overwriting prior content) rather than appending. If str() is ever used mid-build (e.g., for incremental writes), this can corrupt output.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Signed-off-by: Juan Cruz Viotti jv@jviotti.com