llnl / llnl/conduit

cpp, using Node::operator[] with a char crashes

Open
#192 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
248
Forks
72
Avg merge
1d 16h
Merged PRs (30d)
15

Description

In a test, i accidentally typed `'a'` instead of `"a"`
```
Node n;
n['a'] = "something";
```

The char `a` gets cast as int, which maps to a call to `Node::child(index_t idx)`, then this crashes b/c the int value of `a` is of course not a valid index.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating Node::operator[] and Node::child(index_t idx), then inspect the existing test where the accidental n['a'] access was observed. The issue does not specify whether character indexing should be rejected or handled differently, so confirm the intended behavior before adding a regression test and verifying that the crash is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
hpc
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.