PERFORCE change 38889 for review

Andrew Reisse areisse at FreeBSD.org
Tue Sep 30 15:32:08 GMT 2003


http://perforce.freebsd.org/chv.cgi?CH=38889

Change 38889 by areisse at 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;
 }
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list