From 47d1509d824741327b034d12c1847cae775f7eb2 Mon Sep 17 00:00:00 2001 From: Jim Norman Date: Thu, 6 Jul 2006 18:06:31 +0000 Subject: [PATCH] Bug 190532. Compute properly length when escaping SecretIDs --- CASA/CASA.changes | 4 ++++ CASA/micasadk/sscs_ndk.c | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CASA/CASA.changes b/CASA/CASA.changes index 23fc6c00..4608a784 100644 --- a/CASA/CASA.changes +++ b/CASA/CASA.changes @@ -1,3 +1,7 @@ +-------------------------------------------------------------------- +Thu Jul 06 12:04:53 MST 2006 - jnorman@novell.com +- Bug 190532. Compute properly length when escaping SecretIDs + -------------------------------------------------------------------- Mon Jul 05 12:22:53 MST 2006 - jnorman@novell.com - Bug 176460. Added a filewatcher on file in question diff --git a/CASA/micasadk/sscs_ndk.c b/CASA/micasadk/sscs_ndk.c index 32639c6c..d035c07d 100644 --- a/CASA/micasadk/sscs_ndk.c +++ b/CASA/micasadk/sscs_ndk.c @@ -23,6 +23,7 @@ #include #include + #include "micasa_types.h" #include "micasa.h" #include "sscs_lldefs.h" @@ -173,7 +174,7 @@ static void sscsshs_ChkEscapeString { /* beginning of the call */ /* ########################## DECLARATIONS START HERE ######################### */ - int len = 0, i, k = 0, tmplen = 0, escaped = 0; + int len = 0, i, k = 0, tmplen = 0, escaped = 0, escapedAdded = 0; SS_UTF8_T *tempBuf = NULL; /* ############################## CODE STARTS HERE ############################ */ @@ -201,18 +202,21 @@ static void sscsshs_ChkEscapeString tempBuf[k++] = (SS_UTF8_T)'\\'; tempBuf[k++] = (SS_UTF8_T)'\\'; escaped = 1; + escapedAdded++; break; case (SS_UTF8_T)':': tempBuf[k++] = (SS_UTF8_T)'\\'; tempBuf[k++] = (SS_UTF8_T)':'; escaped = 1; + escapedAdded++; break; case (SS_UTF8_T)'=': tempBuf[k++] = (SS_UTF8_T)'\\'; tempBuf[k++] = (SS_UTF8_T)'='; escaped = 1; + escapedAdded++; break; default: @@ -225,7 +229,7 @@ static void sscsshs_ChkEscapeString memset(*entryBuf, 0, *entryBufLen); free (*entryBuf); *entryBuf = tempBuf; - *entryBufLen = *entryBufLen + k; + *entryBufLen = *entryBufLen + escapedAdded; return; }