Commit cc8f3bf
gpu/utils: fix null pointer arithmetic UB in mp_log_source
strchr() can return NULL when no newline is found. Computing end + 1
before the null check on end is undefined behaviour per C11 6.5.6.
Move the next assignment inside the else branch to avoid the UB.1 parent e0f54ad commit cc8f3bf
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
343 | | - | |
| 342 | + | |
| 343 | + | |
344 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
345 | 348 | | |
346 | 349 | | |
347 | 350 | | |
| |||
0 commit comments