Commit 58d6c25
committed
Cygwin: dladdr: use proper max size of dli_fname.
The DL_info::dli_fname member is actually PATH_MAX bytes, so specify
that (larger) size to cygwin_conv_path rather than MAX_PATH.
Also, use a tmp_pathbuf for the GetModuleFileNameW buffer, so that any
buffer size limitation will definitely be due to the size of dli_fname,
and add a static_assert of the size of dli_fname so we can be sure we're
using the right size constant here.
Fixes: c8432a0 ("Implement dladdr() (partially)")
Addresses: rust-lang/backtrace-rs#704 (comment)
Signed-off-by: Jeremy Drake <[email protected]>1 parent 3819160 commit 58d6c25
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
430 | | - | |
431 | | - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
432 | 433 | | |
433 | 434 | | |
434 | 435 | | |
| 436 | + | |
435 | 437 | | |
436 | | - | |
| 438 | + | |
437 | 439 | | |
438 | 440 | | |
439 | 441 | | |
| |||
0 commit comments