Check lseek(fd, 0, SEEK_CUR) for -1 return value.
Not actually possible in practice. Coverity CID 220568.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: ISC
|
* SPDX-License-Identifier: ISC
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2020 Todd C. Miller <Todd.Miller@sudo.ws>
|
* Copyright (c) 2014-2021 Todd C. Miller <Todd.Miller@sudo.ws>
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this software for any
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
@@ -304,6 +304,8 @@ ts_write(int fd, const char *fname, struct timestamp_entry *entry, off_t offset)
|
|||||||
|
|
||||||
if (offset == -1) {
|
if (offset == -1) {
|
||||||
old_eof = lseek(fd, 0, SEEK_CUR);
|
old_eof = lseek(fd, 0, SEEK_CUR);
|
||||||
|
if (old_eof == -1)
|
||||||
|
debug_return_ssize_t(-1);
|
||||||
nwritten = write(fd, entry, entry->size);
|
nwritten = write(fd, entry, entry->size);
|
||||||
} else {
|
} else {
|
||||||
old_eof = offset;
|
old_eof = offset;
|
||||||
|
Reference in New Issue
Block a user