Commit 2b98cc8
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]>
(cherry picked from commit 38772dd)1 parent 2d529bc commit 2b98cc8
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | | - | |
425 | | - | |
426 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
427 | 428 | | |
428 | 429 | | |
429 | 430 | | |
| 431 | + | |
430 | 432 | | |
431 | | - | |
| 433 | + | |
432 | 434 | | |
433 | 435 | | |
434 | 436 | | |
| |||
0 commit comments