Remove \n, \t, \r from strings.

This commit is contained in:
Jim Norman 2006-11-13 06:17:50 +00:00
parent 9b647e40e7
commit 6ff1180a82

View File

@ -69,7 +69,7 @@ static int32_t sscsshs_AddSHSEntry
{ /* beginning of the call */ { /* beginning of the call */
/* ############################## CODE STARTS HERE ############################ */ /* ############################## CODE STARTS HERE ############################ */
if((keyLen) && (secretHandle)) if((keyLen) && (valLen) && (secretHandle))
{ {
if(ll_InsertSharedSecretLink((LL_LINKLIST_T*)secretHandle, if(ll_InsertSharedSecretLink((LL_LINKLIST_T*)secretHandle,
keyLen, key, valLen, val)) keyLen, key, valLen, val))
@ -198,6 +198,13 @@ static void sscsshs_ChkEscapeString
switch(c) switch(c)
{ {
case (SS_UTF8_T)'\n':
case (SS_UTF8_T)'\r':
case (SS_UTF8_T)'\t':
k++;
escaped = 1;
break;
case (SS_UTF8_T)'\\': case (SS_UTF8_T)'\\':
tempBuf[k++] = (SS_UTF8_T)'\\'; tempBuf[k++] = (SS_UTF8_T)'\\';
tempBuf[k++] = (SS_UTF8_T)'\\'; tempBuf[k++] = (SS_UTF8_T)'\\';
@ -1130,6 +1137,7 @@ miCASAReadSecret
memset(key, 0, NSSCS_MAX_SECRET_ID_LEN); memset(key, 0, NSSCS_MAX_SECRET_ID_LEN);
memset(val, 0, NSSCS_MAX_SECRET_BUF_LEN); memset(val, 0, NSSCS_MAX_SECRET_BUF_LEN);
kLen = vLen = 0;
} }
// did we exhaust the buffer? // did we exhaust the buffer?
@ -2811,7 +2819,7 @@ miCASA_AddSHSEntry
/* ############################## CODE STARTS HERE ############################ */ /* ############################## CODE STARTS HERE ############################ */
if((keyLen) && (secretHandle)) if((keyLen) && (valueLen) && (secretHandle))
{ {
if(ll_InsertSharedSecretLink((LL_LINKLIST_T*)secretHandle, if(ll_InsertSharedSecretLink((LL_LINKLIST_T*)secretHandle,
keyLen, key, valueLen, value)) keyLen, key, valueLen, value))