Questions tagged [coverity]

Coverity is a static code analysis tool for C, C++ and other programming languages.

Coverity is a static code analysis tool for C, C++ and other programming languages.

Synopsys offers a free online version of Coverity called Coverity Scan available for opensource projects.

322 questions
3
votes
1 answer

Temporary bound references to struct members

I was trying Coverity out on some code base and I got a warning on a code akin to struct Foo { std::string name; }; Foo getFoo(); //... const auto& name = getFoo().name; useName(name); Is this code valid? I had the intuition that it's indeed…
0xd34df00d
  • 1,496
  • 1
  • 8
  • 17
3
votes
2 answers

getenv returns tainted string content

Coverity is claiming getenv is returning a tainted string and I've exhausted all of my ideas for return value checking. I looked at the other questions similar to mine, but none of their solutions worked for me. I've tried checking the return for…
AsiaRican
  • 75
  • 1
  • 13
3
votes
0 answers

Coverity memccpy issue

Here is the code snippet typedef struct { unsigned char L2maclegacyString2[14]; }L2macLegacyLogPayload; L2macLegacyLogPayload* _lData_=(L2macLegacyLogPayload*)buffData;…
3
votes
1 answer

How do I ignore /usr/include in Coverity Scan?

I've set up a project to use Coverity Scan. Under Analysis Settings→Project Components I have Component name Pattern Ignore in analysis cxxopts .*/src/cxxopts.hpp Yes STL /usr/include/c++/.* …
unhammer
  • 4,306
  • 2
  • 39
  • 52
3
votes
1 answer

Coverity Connect URL for a snapshot

Coverity version - 7.7 In our CI tool, every developer commit, we run cov-analyze and cov-commit-defects and cov-commit-defects outputs the 'Snapshot ID' of the committed version. For…
Vinod
  • 251
  • 3
  • 13
3
votes
3 answers

Does Coverity have Rest API

I want to store results from Coverity® to InfluxDB and I was wondering does Coverity have REST API?
s11me0n
  • 43
  • 1
  • 4
3
votes
0 answers

What is the criteria for the MISSING_MOVE_ASSIGNMENT finding?

We started scanning cross-platform code base with Coverity on Windows. On Windows we picked up five Missing move assignment operator (MISSING_MOVE_ASSIGNMENT) findings. The findings are not present on Unix, Linux or OS X. We are a C++ library…
jww
  • 97,681
  • 90
  • 411
  • 885
3
votes
1 answer

TravisCI / Coverity: Warning - No files were emitted

I have a medium size github repository for which I configured Travis-CI/Coverity tools. About a month ago my setup had worked just fine: Travis compiled and built my application, and then performed the Coverity scan and I could see the results on my…
vicrucann
  • 1,703
  • 1
  • 24
  • 34
3
votes
1 answer

Coverity scan on travis matrix build

I am adding [coverity scan][1] to my project, but I'm facing problem with the quota limits because my travis build is using matrix. I manage to run a custom coverity script (via build_script_url option) to filter my building job: #!/bin/sh set…
Martin Delille
  • 11,360
  • 15
  • 65
  • 132
3
votes
3 answers

how to remove a project from coverity-scan

I've registered a project with coverity-scan in the past. I would now like to remove that project from coverity-scan (or at least from my dashboard; but preferrably i'd like to remove the project entirely). I'm stuck as there seems to be no such…
umläute
  • 28,885
  • 9
  • 68
  • 122
3
votes
1 answer

Coverity: How to use cov-import-scm to extract scm data

I need to assign owners to the coverity defects assigned. On the Coverity platform, the scm users are mapped to coverity users. On the Client side, I to run cov-import-scm to gather the scm data but looks like the command is not getting what it…
Shobha
  • 31
  • 1
  • 2
3
votes
2 answers

Coverity warns on default initialization of local variables

There is a coverity warning type: UNUSED_VALUE. This is defined by tool under "Code maintainability issues" UNUSED_VALUE: When a variable is assigned a pointer value returned from a function call and is never used anywhere else in the source code,…
user3800155
3
votes
2 answers

effect of using sprintf / printf using %ld format string instead of %d with int data type

We have some legacy code that at one point in time long data types were refactored to int data types. During this refactor a number of printf / sprintf format statements were left incorrect as %ld instead of changed to %d. For example: int…
kmcnamee
  • 5,097
  • 2
  • 25
  • 36
3
votes
3 answers

Restrict accessing arrays by wrong index

I’m interested in adding a rule to coverity checkers and want to consult if it’s feasible and what is needed to do to achieve. I’m talking about C programming, and I want to restrict the access to arrays using a defined enumerator – and not any…
3
votes
1 answer

coverity static code analysis across branches/projects

We have product code which is maintained across multiple branches. We want to run the Coverity analysis separately for all the branches. As most of the code is same on all the branches, I want to use the analysis result of one branch to another. So…
Ravindra12jan
  • 331
  • 2
  • 13
1 2
3
21 22