#544 Use of uninitialized value in server.c pidfile creation
Closed: Fixed None Opened 13 years ago by sgallagh.

From Coverity:

  100int pidfile(const char *path, const char *name)
  101{
  102    char pid_str[32];
  103    pid_t pid;
  104    char *file;
  105    int fd;
  106    int ret, err;
Declaring variable "len" without initializer.
  107    ssize_t len;
  108    ssize_t size;
  109    ssize_t written;
  110    ssize_t pidlen = sizeof(pid_str - 1);
  111
  112    file = talloc_asprintf(NULL, "%s/%s.pid", path, name);
At conditional (1): "!file" taking the false branch.
  113    if (!file) {
  114        return ENOMEM;
  115    }
  116
  117    fd = open(file, O_RDONLY, 0644);
  118    err = errno;
At conditional (2): "fd != -1" taking the true branch.
  119    if (fd != -1) {
  120
  121        pid_str[pidlen] = '\0';
  122
  123
Using uninitialized value "len".
  124        while ((ret = read(fd, pid_str + len, pidlen - len)) != 0) {
  125            if (ret == -1) {
  126                if (errno == EINTR || errno == EAGAIN) {

Fields changed

status: new => assigned

Fixed by e559171

fixedin: => 1.2.1
resolution: => fixed
status: assigned => closed

Fields changed

rhbz: => 0

Metadata Update from @sgallagh:
- Issue assigned to sgallagh
- Issue set to the milestone: SSSD 1.2.1

7 years ago

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/1586

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Login to comment on this ticket.

Metadata