Commit 9c3d024
Fix crash when architecture string has no hyphen after colon (#1001)
When connecting to QEMU-PPC targets, the architecture string may be
"powerpc:common" which contains a colon but no hyphen. The code was
calling string::replace() with the result of string::find('-') without
checking if find() returned npos, causing a crash.
This fix adds a check for npos before calling replace() in all three
affected adapter files.
Fixes #1000
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 5d3a23c commit 9c3d024
3 files changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
| |||
0 commit comments