mirror of
https://github.com/pbatard/rufus.git
synced 2025-06-07 18:04:43 -04:00
[misc] fix some Coverity issues
* Also add a Coverity build script and update Bled to latest
This commit is contained in:
parent
6bf699a3f8
commit
a783eeef22
6 changed files with 42 additions and 15 deletions
|
@ -116,10 +116,10 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
|
|||
/* rpm-style temp file name */
|
||||
dst_name = xasprintf("%s;%x", dst_name, (int)getpid());
|
||||
#endif
|
||||
dst_fd = xopen3(dst_name,
|
||||
flags,
|
||||
file_header->mode
|
||||
);
|
||||
dst_fd = open(dst_name, flags, file_header->mode);
|
||||
if (dst_fd < 0) {
|
||||
bb_perror_msg_and_die("can't open file %s", dst_name);
|
||||
}
|
||||
bb_copyfd_exact_size(archive_handle->src_fd, dst_fd, file_header->size);
|
||||
close(dst_fd);
|
||||
#ifdef ARCHIVE_REPLACE_VIA_RENAME
|
||||
|
|
|
@ -173,6 +173,15 @@ static inline pid_t wait(int* status) { *status = 4; return -1; }
|
|||
extern uint64_t bb_total_rb;
|
||||
static inline int full_read(int fd, void *buf, size_t count) {
|
||||
int rb;
|
||||
|
||||
if (fd < 0) {
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
if (buf == NULL) {
|
||||
errno = EFAULT;
|
||||
return -1;
|
||||
}
|
||||
if ((bled_cancel_request != NULL) && (*bled_cancel_request != 0)) {
|
||||
errno = EINTR;
|
||||
return -1;
|
||||
|
@ -198,7 +207,6 @@ static inline struct tm *localtime_r(const time_t *timep, struct tm *result) {
|
|||
#define xmalloc malloc
|
||||
#define xzalloc(x) calloc(x, 1)
|
||||
#define malloc_or_warn malloc
|
||||
#define xopen3 open
|
||||
#define mkdir(x, y) _mkdirU(x)
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue