Commit 808c02b
committed
daemon: parse apid/ctid in dlt_daemon_control_get_log_info_v2
Companion fix to the OOB-read fix in this same commit series. The
function never assigned req->apid or req->ctid: req is calloc'd, so
the char * pointer fields start NULL, and the dlt_set_id_v2(req->apid,
...) call to populate them was a no-op (dlt_set_id_v2 early-returns
when its destination is NULL). req->apid / req->ctid stayed NULL and
were then passed to dlt_daemon_application_find_v2 and
dlt_daemon_context_find_v2 despite req->apidlen / req->ctidlen being
non-zero — every non-empty lookup was silently turned into a
zero-length one.
Replace the no-op dlt_set_id_v2 calls with conditional pointer
assignments into msg->databuffer, mirroring the surgical approach
taken for set_log_level_v2 in PR COVESA#864 and unregister_context_v2 in
PR COVESA#868. The bounds checks added in the previous commit ensure the
pointer-into-databuffer assignments are safe.
Closes COVESA#870.
Related: COVESA#866.1 parent cc31ed3 commit 808c02b
1 file changed
Lines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2163 | 2163 | | |
2164 | 2164 | | |
2165 | 2165 | | |
2166 | | - | |
2167 | | - | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
2168 | 2177 | | |
2169 | 2178 | | |
2170 | 2179 | | |
| |||
2175 | 2184 | | |
2176 | 2185 | | |
2177 | 2186 | | |
2178 | | - | |
2179 | | - | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
2180 | 2191 | | |
2181 | 2192 | | |
2182 | 2193 | | |
| |||
0 commit comments