mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 01:07:52 +00:00
Fix a potential problem in the BFD library when accessing the Windows' nul device driver.
PR 29947 * bfdio.c (_bfd_real_fopen): Do not add a prefix to the Windows' nul device filename.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2023-01-03 Himal <himalr@proton.me>
|
||||
|
||||
PR 29947
|
||||
* bfdio.c (_bfd_real_fopen): Do not add a prefix to the Windows'
|
||||
nul device filename.
|
||||
|
||||
2023-01-03 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* po/fr.po: Updated French trabslation.
|
||||
|
||||
@@ -154,6 +154,11 @@ _bfd_real_fopen (const char *filename, const char *modes)
|
||||
wcscpy (fullPath, prefix);
|
||||
|
||||
int prefixLen = sizeof(prefix) / sizeof(wchar_t);
|
||||
|
||||
/* Do not add a prefix to the null device. */
|
||||
if (stricmp (filename, "nul") == 0)
|
||||
prefixLen = 1;
|
||||
|
||||
wchar_t * fullPathOffset = fullPath + prefixLen - 1;
|
||||
|
||||
GetFullPathNameW (partPath, fullPathWSize, fullPathOffset, lpFilePart);
|
||||
|
||||
Reference in New Issue
Block a user