Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
332f02f8
Commit
332f02f8
authored
Feb 21, 2015
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use FLEXIBLE_ARRAY_MEMBER in Windows-specific code.
Be a tad more paranoid about overlength input, too.
parent
82a532b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/port/dirmod.c
src/port/dirmod.c
+6
-6
No files found.
src/port/dirmod.c
View file @
332f02f8
...
@@ -143,7 +143,7 @@ typedef struct
...
@@ -143,7 +143,7 @@ typedef struct
WORD
SubstituteNameLength
;
WORD
SubstituteNameLength
;
WORD
PrintNameOffset
;
WORD
PrintNameOffset
;
WORD
PrintNameLength
;
WORD
PrintNameLength
;
WCHAR
PathBuffer
[
1
];
WCHAR
PathBuffer
[
FLEXIBLE_ARRAY_MEMBER
];
}
REPARSE_JUNCTION_DATA_BUFFER
;
}
REPARSE_JUNCTION_DATA_BUFFER
;
#define REPARSE_JUNCTION_DATA_BUFFER_HEADER_SIZE \
#define REPARSE_JUNCTION_DATA_BUFFER_HEADER_SIZE \
...
@@ -160,7 +160,7 @@ pgsymlink(const char *oldpath, const char *newpath)
...
@@ -160,7 +160,7 @@ pgsymlink(const char *oldpath, const char *newpath)
{
{
HANDLE
dirhandle
;
HANDLE
dirhandle
;
DWORD
len
;
DWORD
len
;
char
buffer
[
MAX_PATH
*
sizeof
(
WCHAR
)
+
sizeof
(
REPARSE_JUNCTION_DATA_BUFFER
)];
char
buffer
[
MAX_PATH
*
sizeof
(
WCHAR
)
+
offsetof
(
REPARSE_JUNCTION_DATA_BUFFER
,
PathBuffer
)];
char
nativeTarget
[
MAX_PATH
];
char
nativeTarget
[
MAX_PATH
];
char
*
p
=
nativeTarget
;
char
*
p
=
nativeTarget
;
REPARSE_JUNCTION_DATA_BUFFER
*
reparseBuf
=
(
REPARSE_JUNCTION_DATA_BUFFER
*
)
buffer
;
REPARSE_JUNCTION_DATA_BUFFER
*
reparseBuf
=
(
REPARSE_JUNCTION_DATA_BUFFER
*
)
buffer
;
...
@@ -174,10 +174,10 @@ pgsymlink(const char *oldpath, const char *newpath)
...
@@ -174,10 +174,10 @@ pgsymlink(const char *oldpath, const char *newpath)
return
-
1
;
return
-
1
;
/* make sure we have an unparsed native win32 path */
/* make sure we have an unparsed native win32 path */
if
(
memcmp
(
"
\\
??
\\
"
,
oldpath
,
4
))
if
(
memcmp
(
"
\\
??
\\
"
,
oldpath
,
4
)
!=
0
)
s
printf
(
nativeTarget
,
"
\\
??
\\
%s"
,
oldpath
);
s
nprintf
(
nativeTarget
,
sizeof
(
nativeTarget
)
,
"
\\
??
\\
%s"
,
oldpath
);
else
else
str
cpy
(
nativeTarget
,
oldpath
);
str
lcpy
(
nativeTarget
,
oldpath
,
sizeof
(
nativeTarget
)
);
while
((
p
=
strchr
(
p
,
'/'
))
!=
NULL
)
while
((
p
=
strchr
(
p
,
'/'
))
!=
NULL
)
*
p
++
=
'\\'
;
*
p
++
=
'\\'
;
...
@@ -239,7 +239,7 @@ pgreadlink(const char *path, char *buf, size_t size)
...
@@ -239,7 +239,7 @@ pgreadlink(const char *path, char *buf, size_t size)
{
{
DWORD
attr
;
DWORD
attr
;
HANDLE
h
;
HANDLE
h
;
char
buffer
[
MAX_PATH
*
sizeof
(
WCHAR
)
+
sizeof
(
REPARSE_JUNCTION_DATA_BUFFER
)];
char
buffer
[
MAX_PATH
*
sizeof
(
WCHAR
)
+
offsetof
(
REPARSE_JUNCTION_DATA_BUFFER
,
PathBuffer
)];
REPARSE_JUNCTION_DATA_BUFFER
*
reparseBuf
=
(
REPARSE_JUNCTION_DATA_BUFFER
*
)
buffer
;
REPARSE_JUNCTION_DATA_BUFFER
*
reparseBuf
=
(
REPARSE_JUNCTION_DATA_BUFFER
*
)
buffer
;
DWORD
len
;
DWORD
len
;
int
r
;
int
r
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment