• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / tarantool / 5852996244
88%

Build:
DEFAULT BRANCH: master
Ran 14 Aug 2023 07:31AM UTC
Jobs 1
Files 490
Run time 22s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Aug 2023 07:22AM UTC coverage: 86.181% (-0.04%) from 86.218%
5852996244

push

github

locker
popen: fix memcpy(dst, NULL, 0)

The `popen_new()` function may be called with inherit_fds = NULL,
nr_inherit_fds = 0. The lua/popen.c code actually does this.

It leads to the following memcpy() call.

```
memcpy(dst, NULL, 0);
```

According to the C11 standard (n1256, 7.21.1), the pointer argument
should have a valid value, which means pointing to some area in the
program's address space, not NULL. The standard doesn't make an
exception for a zero size array.

Personally I doubt that any memcpy() implementation attempts to
dereference the source pointer in case of a zero size, but it is my
assumption, while the standard is the standard.

The problem is found by Coverity.

Follows up #8926

NO_DOC=it is a bug
NO_CHANGELOG=this code is not released yet
NO_TEST=verified by existing test cases, which call popen.new() without
        the inherit_fds option

63544 of 115175 branches covered (55.17%)

2 of 2 new or added lines in 1 file covered. (100.0%)

95266 of 110542 relevant lines covered (86.18%)

2856070.71 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5852996244.1 14 Aug 2023 07:32AM UTC 0
86.18
GitHub Action Run
Source Files on build 5852996244
Detailed source file information is not available for this build.
  • Back to Repo
  • a4e21fec on github
  • Prev Build on master (#5832670545)
  • Next Build on master (#5855722138)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc