Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Issue Boards

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #29805

Closed (moved)
Open
Opened Mar 18, 2019 by George Kadianakis@asn

41 coverity defects on prob_distr.c

The DIST_BASE_TYPED macro in prob_distr.h is causing us 41 new coverity defects. I don't think it's wrong but it's quite hacky so we should fix it in some way.

*** CID 1444029:  Incorrect expression  (SIZEOF_MISMATCH)
/src/lib/math/prob_distr.c: 1511 in log_logistic_sf()
1505       return cdf_log_logistic(x, LL->alpha, LL->beta);
1506     }
1507     
1508     static double
1509     log_logistic_sf(const struct dist *dist, double x)
1510     {
>>>     CID 1444029:  Incorrect expression  (SIZEOF_MISMATCH)
>>>     Adding "0UL /* 0 * sizeof (dist - &((struct log_logistic const *)((char const *)dist - __builtin_offsetof()))->base) */" to pointer
>>> "(struct log_logistic const *)((char const *)dist - 0UL)" of type "struct log_logistic const *" is suspicious because adding an integral value
>>> to this pointer automatically scales that value by the size, 24 bytes, of the pointed-to type, "struct log_logistic const".  Most likely, the
>>> multiplication by "sizeof (dist - &((struct log_logistic const *)((char const *)dist - 0UL))->base)" in this expression is extraneous and
>>> should be eliminated.
1511       const struct log_logistic *LL = const_container_of(dist,
1512         struct log_logistic, base);
1513     
1514       return sf_log_logistic(x, LL->alpha, LL->beta);
1515     }
1516     
To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
Tor: 0.4.1.x-final
Milestone
Tor: 0.4.1.x-final
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#29805