git.samba.org
/
metze
/
samba
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb9ce06
)
s3: VFS: Protect errno if sys_getwd() fails across free() call.
author
Jeremy Allison
<jra@samba.org>
Tue, 3 Oct 2017 17:58:00 +0000
(10:58 -0700)
committer
Ralph Boehme
<slow@samba.org>
Wed, 4 Oct 2017 08:06:15 +0000
(10:06 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13069
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/lib/system.c
patch
|
blob
|
history
diff --git
a/source3/lib/system.c
b/source3/lib/system.c
index 5baa8f7d3ff0e841389d0e430508350e94902045..507d4a9af93a824c8e9c2ae96088dc7afd021560 100644
(file)
--- a/
source3/lib/system.c
+++ b/
source3/lib/system.c
@@
-594,7
+594,9
@@
char *sys_getwd(void)
break;
}
if (errno != ERANGE) {
+ int saved_errno = errno;
SAFE_FREE(s);
+ errno = saved_errno;
break;
}
allocated *= 2;
@@
-612,7
+614,9
@@
char *sys_getwd(void)
}
wd = getwd(s);
if (wd == NULL) {
+ int saved_errno = errno;
SAFE_FREE(s);
+ errno = saved_errno;
}
return wd;
#endif