Browse Source

Fix a purely theoretical NULL-pointer dereference in the case that we

would be able to receive multiple SCM_RIGHTS messages.
ok claudio@ gilles@
OPENBSD_5_3
reyk 12 years ago
parent
commit
d1b4498645
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/lib/libutil/imsg.c

+ 2
- 2
src/lib/libutil/imsg.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: imsg.c,v 1.2 2012/06/02 21:46:53 gilles Exp $ */
/* $OpenBSD: imsg.c,v 1.3 2012/12/19 13:37:12 reyk Exp $ */
/* /*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -103,7 +103,7 @@ again:
(char *)CMSG_DATA(cmsg)) / sizeof(int); (char *)CMSG_DATA(cmsg)) / sizeof(int);
for (i = 0; i < j; i++) { for (i = 0; i < j; i++) {
fd = ((int *)CMSG_DATA(cmsg))[i]; fd = ((int *)CMSG_DATA(cmsg))[i];
if (i == 0) {
if (ifd != NULL) {
ifd->fd = fd; ifd->fd = fd;
TAILQ_INSERT_TAIL(&ibuf->fds, ifd, TAILQ_INSERT_TAIL(&ibuf->fds, ifd,
entry); entry);


Loading…
Cancel
Save