Date: Tue, 30 Sep 2003 08:32:08 -0700 (PDT) From: Andrew Reisse <areisse@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 38889 for review Message-ID: <200309301532.h8UFW81Z092302@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=38889 Change 38889 by areisse@areisse_tislabs on 2003/09/30 08:32:04 properly initialize sidtab structures don't divide by zero when empty policy files are loaded Affected files ... .. //depot/projects/trustedbsd/sebsd/sys/security/sebsd/ss/fileutils.c#5 edit .. //depot/projects/trustedbsd/sebsd/sys/security/sebsd/ss/sidtab.c#7 edit Differences ... ==== //depot/projects/trustedbsd/sebsd/sys/security/sebsd/ss/fileutils.c#5 (text+ko) ==== @@ -107,6 +107,9 @@ size_t fread(void *ptr, size_t size, size_t nmemb, FILE *fp) { + if (size == 0) + return 0; + struct thread *td = curthread; fp->FILE_uio.uio_iov->iov_base = ptr; ==== //depot/projects/trustedbsd/sebsd/sys/security/sebsd/ss/sidtab.c#7 (text+ko) ==== @@ -42,6 +42,7 @@ s->nel = 0; s->next_sid = 1; s->shutdown = 0; + memset (&s->lock, 0, sizeof (struct mtx)); INIT_SIDTAB_LOCK(s); return 0; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309301532.h8UFW81Z092302>