summaryrefslogtreecommitdiffstats
path: root/source3/include
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-02-16 19:44:18 +0000
committerTim Potter <tpot@samba.org>2002-02-16 19:44:18 +0000
commit1eb1433cf32d174ac411d25f2a98018163bfca6d (patch)
tree07ccb0024850aa267cce727ad3167e13b1d97eb6 /source3/include
parent3e5efdb05c91dff204967d1e8dd33a86ab2602f2 (diff)
downloadsamba-1eb1433cf32d174ac411d25f2a98018163bfca6d.tar.gz
samba-1eb1433cf32d174ac411d25f2a98018163bfca6d.tar.xz
samba-1eb1433cf32d174ac411d25f2a98018163bfca6d.zip
Added some splint annotations from andreas.
(This used to be commit 60e84540fd8c27975066f7c7984d30bc88f6da5f)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/safe_string.h7
-rw-r--r--source3/include/smb.h7
2 files changed, 14 insertions, 0 deletions
diff --git a/source3/include/safe_string.h b/source3/include/safe_string.h
index 9f64bc44e3..487174dec3 100644
--- a/source3/include/safe_string.h
+++ b/source3/include/safe_string.h
@@ -21,6 +21,11 @@
#ifndef _SAFE_STRING_H
#define _SAFE_STRING_H
+#ifndef _SPLINT_ /* http://www.splint.org */
+
+/* Some macros to ensure people don't use buffer overflow vulnerable string
+ functions. */
+
#ifdef strcpy
#undef strcpy
#endif /* strcpy */
@@ -36,6 +41,8 @@
#endif /* sprintf */
#define sprintf __ERROR__XX__NEVER_USE_SPRINTF__;
+#endif /* !_SPLINT_ */
+
#define pstrcpy(d,s) safe_strcpy((d), (s),sizeof(pstring)-1)
#define pstrcat(d,s) safe_strcat((d), (s),sizeof(pstring)-1)
#define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1)
diff --git a/source3/include/smb.h b/source3/include/smb.h
index cdb4fa762b..6f05868a3f 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -193,11 +193,18 @@ typedef struct nttime_info
} NTTIME;
+/* The Splint code analysis tool doesn't like immediate structures. */
+
+#ifdef _SPLINT_ /* http://www.splint.org */
+#undef HAVE_IMMEDIATE_STRUCTURES
+#endif
+
/* the following rather strange looking definitions of NTSTATUS and WERROR
and there in order to catch common coding errors where different error types
are mixed up. This is especially important as we slowly convert Samba
from using BOOL for internal functions
*/
+
#if defined(HAVE_IMMEDIATE_STRUCTURES)
typedef struct {uint32 v;} NTSTATUS;
#define NT_STATUS(x) ((NTSTATUS) { x })