Skip to content

Commit

Permalink
Coverity Scan fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Nov 26, 2024
1 parent 950cd2a commit 90c910b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions ogr/ogrsf_frmts/geojson/libjson/json_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ static int _json_object_to_fd(int fd, struct json_object *obj, int flags, const
wpos = 0;
while (wpos < wsize)
{
/* coverity[overflow_sink] */
if ((ret = write(fd, json_str + wpos, wsize - wpos)) < 0)
{
_json_c_set_last_err("json_object_to_file: error writing file %s: %s\n",
Expand Down
2 changes: 2 additions & 0 deletions port/cpl_spawn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ int CPLPipeRead(CPL_FILE_HANDLE fin, void *data, int length)
{
while (true)
{
// coverity[overflow_sink]
const ssize_t n = read(fin, pabyData, nRemain);
if (n < 0)
{
Expand Down Expand Up @@ -499,6 +500,7 @@ int CPLPipeWrite(CPL_FILE_HANDLE fout, const void *data, int length)
{
while (true)
{
// coverity[overflow_sink]
const ssize_t n = write(fout, pabyData, nRemain);
if (n < 0)
{
Expand Down
2 changes: 1 addition & 1 deletion port/cpl_vsil_curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ vsi_l_offset VSICurlHandle::GetFileSizeOrHeaders(bool bSetError,
if (osValue.size() >= 2 && osValue.front() == '"' &&
osValue.back() == '"')
osValue = osValue.substr(1, osValue.size() - 2);
oFileProp.ETag = osValue;
oFileProp.ETag = std::move(osValue);
}

// Azure Data Lake Storage
Expand Down

0 comments on commit 90c910b

Please sign in to comment.