mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge remote-tracking branch 'public/bug7816_023'
Conflicts: src/common/util.c
This commit is contained in:
+3
-1
@@ -833,8 +833,10 @@ add_file_log(const log_severity_list_t *severity, const char *filename)
|
||||
fd = tor_open_cloexec(filename, O_WRONLY|O_CREAT|O_APPEND, 0644);
|
||||
if (fd<0)
|
||||
return -1;
|
||||
if (tor_fd_seekend(fd)<0)
|
||||
if (tor_fd_seekend(fd)<0) {
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
LOCK_LOGS();
|
||||
add_stream_log_impl(severity, filename, fd);
|
||||
|
||||
+3
-1
@@ -2374,8 +2374,10 @@ read_file_to_str(const char *filename, int flags, struct stat *stat_out)
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((uint64_t)(statbuf.st_size)+1 >= SIZE_T_CEILING)
|
||||
if ((uint64_t)(statbuf.st_size)+1 >= SIZE_T_CEILING) {
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
string = tor_malloc((size_t)(statbuf.st_size+1));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user