Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #31948
Closed (moved) (moved)
Open
Created Oct 03, 2019 by Nick Mathewson@nickm🥄

CID 1454593: passing negative value to memset

Coverity says:

 ________________________________________________________________________________________________________
*** CID 1454593:  Memory - illegal accesses  (NO_EFFECT)
/src/test/test_util.c: 6200 in test_util_map_anon_nofork()
6194       int pipefd[2] = {-1, -1};
6195       unsigned inherit=0;
6196     
6197       tor_munmap_anonymous(ptr, sz);
6198       ptr = tor_mmap_anonymous(sz, ANONMAP_NOINHERIT, &inherit);
6199       tt_ptr_op(ptr, OP_NE, 0);
>>>     CID 1454593:  Memory - illegal accesses  (NO_EFFECT)
>>>     Argument "-48" in "memset" loses precision in "memset(ptr, -48, sz)".
6200       memset(ptr, TEST_VALUE, sz);
6201     
6202       tt_int_op(0, OP_EQ, pipe(pipefd));
6203       pid_t child = fork();
6204       if (child == 0) {
6205         /* We're in the child. */
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking