Index: /trunk/psLib/src/sys/psString.c
===================================================================
--- /trunk/psLib/src/sys/psString.c	(revision 6277)
+++ /trunk/psLib/src/sys/psString.c	(revision 6278)
@@ -13,6 +13,6 @@
  *  @author David Robbins, MHPCC
  *
- *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-01-27 01:49:05 $
+ *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-02-01 20:40:56 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -31,8 +31,10 @@
 psString psStringCopy(const char *string)
 {
+    PS_ASSERT_PTR_NON_NULL(string, NULL);
     // Allocate memory using psAlloc function
     // Copy input string to memory just allocated
     // Return the copy
-    return strcpy(psAlloc(strlen(string) + 1), string);
+    // Pass through NULL values
+    return string ? strcpy(psAlloc(strlen(string) + 1), string) : NULL;
 }
 
@@ -40,4 +42,5 @@
                        unsigned int nChar)
 {
+    PS_ASSERT_PTR_NON_NULL(string, NULL);
     char *returnValue = NULL;
 
@@ -53,5 +56,8 @@
     // Copy input string to memory allocated up to nChar characters
     // Return the copy
-    returnValue = strncpy(psAlloc((size_t) nChar + 1), string, (size_t) nChar);
+    // Pass through NULL values
+    returnValue =
+              string ? strncpy(psAlloc((size_t) nChar + 1), string, (size_t) nChar)
+              : NULL;
 
     // Ensure the last byte is NULL character
@@ -66,4 +72,5 @@
                        ...)
 {
+    PS_ASSERT_PTR_NON_NULL(format, 0);
     va_list         args;
     size_t          length;             // complete string length (sans \0)
@@ -113,4 +120,5 @@
                         ...)
 {
+    PS_ASSERT_PTR_NON_NULL(format, 0);
     va_list         args;
     size_t          length;             // complete string length (sans \0)
Index: /trunk/psLib/src/sys/psString.h
===================================================================
--- /trunk/psLib/src/sys/psString.h	(revision 6277)
+++ /trunk/psLib/src/sys/psString.h	(revision 6278)
@@ -14,6 +14,6 @@
  *  @author David Robbins, MHPCC
  *
- *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-01-26 05:31:54 $
+ *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-02-01 20:40:56 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -38,6 +38,7 @@
 /** Copies the input string
  *
- *  This function shall allocate memory to the length of the input string
- *  plus one and copy the input string to the newly allocated memory.
+ *  This function shall allocate memory to the length of the input string plus
+ *  one and copy the input string to the newly allocated memory.  If 'string'
+ *  is 'NULL' then 'NULL' is returned.
  *
  *  @return psString:      Copy of input string
@@ -55,5 +56,5 @@
  *  string will be a substring of the input string.  If the input string
  *  is smaller than nChar bytes then the remaining bytes allocated will
- *  be set to NULL.
+ *  be set to NULL.  If 'string' is 'NULL' then 'NULL' is returned.
  *
  *  @return  psString:   Copy of input string
Index: /trunk/psLib/src/types/psMetadata.c
===================================================================
--- /trunk/psLib/src/types/psMetadata.c	(revision 6277)
+++ /trunk/psLib/src/types/psMetadata.c	(revision 6278)
@@ -12,6 +12,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.97 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-01-30 20:28:33 $
+ *  @version $Revision: 1.98 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-02-01 20:40:56 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -264,5 +264,10 @@
     case PS_DATA_STRING:
         // Perform copy of input strings
-        metadataItem->data.V = psStringNCopy(va_arg(argPtr, char *), MAX_STRING_LENGTH);
+        {
+            char *string = va_arg(argPtr, char *);
+            metadataItem->data.V =
+                string ? psStringNCopy(string, MAX_STRING_LENGTH)
+                : NULL;
+        }
         break;
     case     PS_DATA_ARRAY:                     // psArray
Index: /trunk/psLib/test/sys/tst_psString.c
===================================================================
--- /trunk/psLib/test/sys/tst_psString.c	(revision 6277)
+++ /trunk/psLib/test/sys/tst_psString.c	(revision 6278)
@@ -20,6 +20,6 @@
  *  @author  Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-01-27 01:49:05 $
+ *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2006-02-01 20:40:56 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -52,4 +52,5 @@
 
 static psS32 testStrSplit00(void);
+static psS32 testNULLStrings(void);
 
 testDescription tests[] = {
@@ -72,4 +73,5 @@
                               {testStrPrepend03,14, "Test prepend null-op", 0, false},
                               {testStrSplit00,15, "Test String Splitting", 0, false},
+                              {testNULLStrings,666, "Test NULL String Error Handling", 0, false},
                               {NULL}
                           };
@@ -619,2 +621,77 @@
 }
 
+static psS32 testNULLStrings(void)
+{
+    psString nullTest = NULL;
+    psString output = NULL;
+    ssize_t outSize = 0;
+    char** nullDest = NULL;
+    char** test;
+    //psStringCopy should return NULL for NULL input string
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    output = psStringCopy(nullTest);
+    if (output != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psStringCopy failed to return NULL for NULL input string.\n");
+        return 1;
+    }
+    //psStringNCopy should return NULL for NULL input string
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    output = psStringNCopy(nullTest, 100);
+    if (output != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psStringNCopy failed to return NULL for NULL input string.\n");
+        return 2;
+    }
+
+    //psStringAppend should return 0 for NULL input destination
+    outSize = psStringAppend(nullDest, "");
+    if (outSize != 0) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psStringAppend failed to return 0 for NULL input destination.\n");
+        return 3;
+    }
+    //psStringAppend should return 0 for NULL input format
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    outSize = psStringAppend(test, nullTest);
+    if (outSize != 0) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psStringAppend failed to return 0 for NULL input format.\n");
+        return 4;
+    }
+    //psStringPrepend should return 0 for NULL input destination
+    outSize = psStringPrepend(nullDest, " ");
+    if (outSize != 0) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psStringPrepend failed to return 0 for NULL input destination.\n");
+        return 3;
+    }
+    //psStringPrepend should return 0 for NULL input format
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    outSize = psStringPrepend(test, nullTest);
+    if (outSize != 0) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psStringPrepend failed to return 0 for NULL input format.\n");
+        return 4;
+    }
+    //psStringSplit should return NULL for NULL input string
+    psList *nullList = NULL;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    nullList = psStringSplit(nullTest, ",");
+    if (nullList != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psStringSplit failed to return NULL for NULL input string.\n");
+        return 5;
+    }
+    //psStringSplit should return NULL for NULL input splitter
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    nullList = psStringSplit("Hello World", nullTest);
+    if (nullList != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psStringSplit failed to return NULL for NULL input splitter.\n");
+        return 6;
+    }
+
+    return 0;
+}
+
Index: /trunk/psLib/test/sys/verified/tst_psString.stderr
===================================================================
--- /trunk/psLib/test/sys/verified/tst_psString.stderr	(revision 6277)
+++ /trunk/psLib/test/sys/verified/tst_psString.stderr	(revision 6278)
@@ -68,4 +68,8 @@
 \**********************************************************************************/
 
+<DATE><TIME>|<HOST>|E|psStringAppend (FILE:LINENO)
+    Unallowable operation: format is NULL.
+<DATE><TIME>|<HOST>|E|psStringAppend (FILE:LINENO)
+    Unallowable operation: format is NULL.
 
 ---> TESTPOINT PASSED (psString{Test append NULL handling} | tst_psString.c)
@@ -104,4 +108,8 @@
 \**********************************************************************************/
 
+<DATE><TIME>|<HOST>|E|psStringPrepend (FILE:LINENO)
+    Unallowable operation: format is NULL.
+<DATE><TIME>|<HOST>|E|psStringPrepend (FILE:LINENO)
+    Unallowable operation: format is NULL.
 
 ---> TESTPOINT PASSED (psString{Test prepend NULL handling} | tst_psString.c)
@@ -146,2 +154,35 @@
 ---> TESTPOINT PASSED (psString{Test String Splitting} | tst_psString.c)
 
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psString.c                                             *
+*            TestPoint: psString{Test NULL String Error Handling}                  *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<DATE><TIME>|<HOST>|I|testNULLStrings
+    Following should generate error message
+<DATE><TIME>|<HOST>|E|psStringCopy (FILE:LINENO)
+    Unallowable operation: string is NULL.
+<DATE><TIME>|<HOST>|I|testNULLStrings
+    Following should generate error message
+<DATE><TIME>|<HOST>|E|psStringNCopy (FILE:LINENO)
+    Unallowable operation: string is NULL.
+<DATE><TIME>|<HOST>|I|testNULLStrings
+    Following should generate error message
+<DATE><TIME>|<HOST>|E|psStringAppend (FILE:LINENO)
+    Unallowable operation: format is NULL.
+<DATE><TIME>|<HOST>|I|testNULLStrings
+    Following should generate error message
+<DATE><TIME>|<HOST>|E|psStringPrepend (FILE:LINENO)
+    Unallowable operation: format is NULL.
+<DATE><TIME>|<HOST>|I|testNULLStrings
+    Following should generate error message
+<DATE><TIME>|<HOST>|E|psStringSplit (FILE:LINENO)
+    Unallowable operation: string is NULL.
+<DATE><TIME>|<HOST>|I|testNULLStrings
+    Following should generate error message
+<DATE><TIME>|<HOST>|E|psStringSplit (FILE:LINENO)
+    Unallowable operation: splitters is NULL.
+
+---> TESTPOINT PASSED (psString{Test NULL String Error Handling} | tst_psString.c)
+
