diff options
author | Thomas Jarosch <thomas.jarosch@intra2net.com> | 2016-07-30 23:40:55 +0200 |
---|---|---|
committer | Thomas Jarosch <thomas.jarosch@intra2net.com> | 2016-07-31 00:06:19 +0200 |
commit | a733a5092b404276af646b522430466df19a1612 (patch) | |
tree | eda9925b1e9b5ed5a1913e4360e4e2ebe4e264db /src/libtracelog/libtracelog.c | |
parent | fixes (diff) | |
download | firejail-a733a5092b404276af646b522430466df19a1612.tar.gz firejail-a733a5092b404276af646b522430466df19a1612.tar.zst firejail-a733a5092b404276af646b522430466df19a1612.zip |
Fix wrong pointer variable in stat64 wrapper
If a program would have called stat() and then stat64(),
the traced program probably would crash
with a NULL pointer access on orig_stat64.
I've checked for similiar glitches in the
other wrappers -> they looked ok.
Diffstat (limited to 'src/libtracelog/libtracelog.c')
-rw-r--r-- | src/libtracelog/libtracelog.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libtracelog/libtracelog.c b/src/libtracelog/libtracelog.c index 3e65587c4..dedba5513 100644 --- a/src/libtracelog/libtracelog.c +++ b/src/libtracelog/libtracelog.c | |||
@@ -562,7 +562,7 @@ int stat64(const char *pathname, struct stat64 *buf) { | |||
562 | #ifdef DEBUG | 562 | #ifdef DEBUG |
563 | printf("%s %s\n", __FUNCTION__, pathname); | 563 | printf("%s %s\n", __FUNCTION__, pathname); |
564 | #endif | 564 | #endif |
565 | if (!orig_stat) | 565 | if (!orig_stat64) |
566 | orig_stat64 = (orig_stat64_t)dlsym(RTLD_NEXT, "stat64"); | 566 | orig_stat64 = (orig_stat64_t)dlsym(RTLD_NEXT, "stat64"); |
567 | if (!blacklist_loaded) | 567 | if (!blacklist_loaded) |
568 | load_blacklist(); | 568 | load_blacklist(); |
@@ -598,7 +598,7 @@ int lstat64(const char *pathname, struct stat64 *buf) { | |||
598 | #ifdef DEBUG | 598 | #ifdef DEBUG |
599 | printf("%s %s\n", __FUNCTION__, pathname); | 599 | printf("%s %s\n", __FUNCTION__, pathname); |
600 | #endif | 600 | #endif |
601 | if (!orig_lstat) | 601 | if (!orig_lstat64) |
602 | orig_lstat64 = (orig_lstat64_t)dlsym(RTLD_NEXT, "lstat64"); | 602 | orig_lstat64 = (orig_lstat64_t)dlsym(RTLD_NEXT, "lstat64"); |
603 | if (!blacklist_loaded) | 603 | if (!blacklist_loaded) |
604 | load_blacklist(); | 604 | load_blacklist(); |