ostree/src/libotutil
Jonathan Lebon 968e8805b0 lib: Fix some logic/error-checking code
Using `MAX(0, $x)` here is useless since we're comparing against an
unsigned integer. Just unpack this and only subtract if it's safe to do
so.

Also, explicitly check for `fd >= 0` rather than just `!= -1` to be sure
it's a valid fd. And finally, explicitly check the return value of
`g_input_stream_read_all` as is done everywhere else in the tree and
make it clear that we're purposely ignoring the return value of `_flush`
here, but not in other places.

Discovered by Coverity.

Closes: #1692
Approved by: cgwalters
2018-07-26 21:01:19 +00:00
..
ot-checksum-instream.c Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-checksum-instream.h Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-checksum-utils.c libotutil/checksum-utils: Fix memory management 2018-03-29 13:45:26 +00:00
ot-checksum-utils.h Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-fs-utils.c libotutil: factor out utility to parse file by line 2018-02-02 22:36:49 +00:00
ot-fs-utils.h libotutil: factor out utility to parse file by line 2018-02-02 22:36:49 +00:00
ot-gio-utils.c Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-gio-utils.h Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-gpg-utils.c lib: Fix some logic/error-checking code 2018-07-26 21:01:19 +00:00
ot-gpg-utils.h Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-keyfile-utils.c Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-keyfile-utils.h Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-opt-utils.c Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-opt-utils.h Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-tool-util.c Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-tool-util.h Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-unix-utils.c Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-unix-utils.h Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-variant-builder.c Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-variant-builder.h Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-variant-utils.c Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
ot-variant-utils.h Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
otutil.h Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00