summaryrefslogtreecommitdiff
path: root/security/trousers/files/patch-src-tspi-rpc-hosttable.c
diff options
context:
space:
mode:
authorNorikatsu Shigemura <nork@FreeBSD.org>2010-11-07 12:05:27 +0000
committerNorikatsu Shigemura <nork@FreeBSD.org>2010-11-07 12:05:27 +0000
commit7612f38ced29eb14aa8c63480da1733c56d714aa (patch)
treea5c28dd8af068213f99b7b54305fd93dac4eb106 /security/trousers/files/patch-src-tspi-rpc-hosttable.c
parent- Update to 0.87. (diff)
Add trousers 0.3.6, is a CPL (Common Public License) licensed Trusted
Computing Software Stack. It is mostly compliant with the TSS 1.2 specification. Obtained from: http://bsssd.sourceforge.net/
Notes
Notes: svn path=/head/; revision=264182
Diffstat (limited to 'security/trousers/files/patch-src-tspi-rpc-hosttable.c')
-rw-r--r--security/trousers/files/patch-src-tspi-rpc-hosttable.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/security/trousers/files/patch-src-tspi-rpc-hosttable.c b/security/trousers/files/patch-src-tspi-rpc-hosttable.c
new file mode 100644
index 000000000000..d86294d7a463
--- /dev/null
+++ b/security/trousers/files/patch-src-tspi-rpc-hosttable.c
@@ -0,0 +1,60 @@
+--- src/tspi/rpc/hosttable.c.orig 2010-05-02 11:39:11.000000000 +0900
++++ src/tspi/rpc/hosttable.c 2010-10-24 21:04:04.845560543 +0900
+@@ -36,8 +36,8 @@
+ }
+
+ #ifdef SOLARIS
+-#pragma init(_init)
+-void _init(void)
++#pragma init(_init_hosttable)
++void _init_hosttable(void)
+ #else
+ void __attribute__ ((constructor)) my_init(void)
+ #endif
+@@ -51,6 +51,8 @@
+ {
+ struct host_table_entry *hte, *next = NULL;
+
++ if( ht == NULL ) return;
++
+ MUTEX_LOCK(ht->lock);
+
+ for (hte = ht->entries; hte; hte = next) {
+@@ -70,8 +72,8 @@
+ }
+
+ #ifdef SOLARIS
+-#pragma fini(_fini)
+-void _fini(void)
++#pragma fini(_fini_hosttable)
++void _fini_hosttable(void)
+ #else
+ void __attribute__ ((destructor)) my_fini(void)
+ #endif
+@@ -84,6 +86,8 @@
+ {
+ struct host_table_entry *entry, *tmp;
+
++ if( ht == NULL ) return TSPERR(TSS_E_OUTOFMEMORY);
++
+ entry = calloc(1, sizeof(struct host_table_entry));
+ if (entry == NULL) {
+ LogError("malloc of %zd bytes failed.", sizeof(struct host_table_entry));
+@@ -134,6 +138,8 @@
+ {
+ struct host_table_entry *hte, *prev = NULL;
+
++ if( ht == NULL ) return;
++
+ MUTEX_LOCK(ht->lock);
+
+ for (hte = ht->entries; hte; prev = hte, hte = hte->next) {
+@@ -158,6 +164,8 @@
+ {
+ struct host_table_entry *index = NULL;
+
++ if( ht == NULL ) return NULL;
++
+ MUTEX_LOCK(ht->lock);
+
+ for (index = ht->entries; index; index = index->next) {