From 2be5446559fd82f6e84571f1e74b74222b46fdeb Mon Sep 17 00:00:00 2001 From: Bruce Allen Date: Thu, 5 Jan 2006 09:30:41 +0000 Subject: [PATCH] Fixed new unescape_string(): didn't null terminate string. svn path=/trunk/boinc/; revision=9176 --- checkin_notes | 7 +++++++ db/db_base.C | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 7523aa5862..972fe74ab4 100755 --- a/checkin_notes +++ b/checkin_notes @@ -73,3 +73,10 @@ David 4 Jan 2006 db/ db_base.C + +Bruce 5 Jan 2006 + - Fixed new unescape_string(): didn't null terminate string. + + db/ + db_base.C + diff --git a/db/db_base.C b/db/db_base.C index 7e1813d16d..559e8e04a8 100644 --- a/db/db_base.C +++ b/db/db_base.C @@ -366,10 +366,11 @@ void unescape_string(char* p, int /*len*/) { while (*p) { if (*p == '\\') { p++; + if (!*p) break; // SHOULD NEVER HAPPEN! } - if (!*p) break; *q++ = *p++; } + *q='\0'; } // replace _ with \\_, % with \\%