diff --git a/CASA/micasadk/sscs_ndk.c b/CASA/micasadk/sscs_ndk.c index e3ed7dd1..6adca060 100644 --- a/CASA/micasadk/sscs_ndk.c +++ b/CASA/micasadk/sscs_ndk.c @@ -69,7 +69,7 @@ static int32_t sscsshs_AddSHSEntry { /* beginning of the call */ /* ############################## CODE STARTS HERE ############################ */ - if((keyLen) && (secretHandle)) + if((keyLen) && (valLen) && (secretHandle)) { if(ll_InsertSharedSecretLink((LL_LINKLIST_T*)secretHandle, keyLen, key, valLen, val)) @@ -198,6 +198,13 @@ static void sscsshs_ChkEscapeString 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)'\\': tempBuf[k++] = (SS_UTF8_T)'\\'; tempBuf[k++] = (SS_UTF8_T)'\\'; @@ -1130,6 +1137,7 @@ miCASAReadSecret memset(key, 0, NSSCS_MAX_SECRET_ID_LEN); memset(val, 0, NSSCS_MAX_SECRET_BUF_LEN); + kLen = vLen = 0; } // did we exhaust the buffer? @@ -2811,7 +2819,7 @@ miCASA_AddSHSEntry /* ############################## CODE STARTS HERE ############################ */ - if((keyLen) && (secretHandle)) + if((keyLen) && (valueLen) && (secretHandle)) { if(ll_InsertSharedSecretLink((LL_LINKLIST_T*)secretHandle, keyLen, key, valueLen, value))