Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
784d509f
Commit
784d509f
authored
Dec 07, 2015
by
Thomas Jahns
🤸
Browse files
Fix potential overwriting of errno.
* va_start, printf, fprintf, vfprintf, va_end are all candidates.
parent
2e7067bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/error.c
View file @
784d509f
...
...
@@ -27,6 +27,7 @@ void SysError_(const char *caller, const char *fmt, ...)
void
SysError_
(
const
char
*
caller
,
const
char
*
fmt
,
...)
{
va_list
args
;
int
saved_errno
=
errno
;
va_start
(
args
,
fmt
);
...
...
@@ -37,8 +38,11 @@ void SysError_(const char *caller, const char *fmt, ...)
va_end
(
args
);
if
(
errno
)
perror
(
"System error message "
);
if
(
saved_errno
)
{
errno
=
saved_errno
;
perror
(
"System error message"
);
}
exit
(
EXIT_FAILURE
);
}
...
...
src/grid.c
View file @
784d509f
...
...
@@ -78,8 +78,6 @@ static const resOps gridOps = {
gridTxCode
};
static
const
struct
gridVirtTable
serialGridVtable
;
static
int
GRID_Debug
=
0
;
/* If set to 1, debugging */
grid_t
*
gridID2Ptr
(
int
gridID
)
...
...
@@ -163,7 +161,7 @@ void grid_init(grid_t *gridptr)
gridptr
->
ystdname
=
NULL
;
memset
(
gridptr
->
uuid
,
0
,
CDI_UUID_SIZE
);
gridptr
->
name
=
NULL
;
gridptr
->
vtable
=
&
serial
GridVtable
;
gridptr
->
vtable
=
&
cdi
GridVtable
;
gridptr
->
extraData
=
NULL
;
}
...
...
@@ -4697,7 +4695,7 @@ int varDefGrid(int vlistID, const grid_t *grid, int mode)
return
(
gridID
);
}
static
const
struct
gridVirtTable
serial
GridVtable
const
struct
gridVirtTable
cdi
GridVtable
=
{
.
destroy
=
gridDestroyKernel
,
.
duplicateData
=
gridDuplicateData
,
...
...
src/grid.h
View file @
784d509f
...
...
@@ -104,6 +104,7 @@ struct grid_t {
void
grid_init
(
grid_t
*
gridptr
);
void
grid_free
(
grid_t
*
gridptr
);
grid_t
*
gridID2Ptr
(
int
gridID
);
extern
const
struct
gridVirtTable
cdiGridVtable
;
unsigned
cdiGridCount
(
void
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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