aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-16 09:03:40 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-16 09:03:40 +0000
commit25733e05cccb47c4a28e9a6b6dccfc9d7f1e2790 (patch)
treeb77d5453a3e5718836ad9a4fb470f5ef90f05c7a
parent528b54f3b98edcfe3aa3188e6df0985c217c7049 (diff)
Only increment the pointer once per loop, otherwise we corrupt the value.
(closes issue #18251) Reported by: bcnit Patches: 20101110__issue18251.diff.txt uploaded by tilghman (license 14) Tested by: trev, jthurman, elguero (closes issue #18279) Reported by: zerohalo Patches: 20101109__issue18279.diff.txt uploaded by tilghman (license 14) Tested by: zerohalo git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@298480 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--res/res_config_odbc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/res/res_config_odbc.c b/res/res_config_odbc.c
index daed738d2..52913507d 100644
--- a/res/res_config_odbc.c
+++ b/res/res_config_odbc.c
@@ -67,7 +67,7 @@ struct custom_prepare_struct {
static void decode_chunk(char *chunk)
{
for (; *chunk; chunk++) {
- if (*chunk == '^' && strchr("0123456789ABCDEFabcdef", chunk[1]) && strchr("0123456789ABCDEFabcdef", chunk[2])) {
+ if (*chunk == '^' && strchr("0123456789ABCDEF", chunk[1]) && strchr("0123456789ABCDEF", chunk[2])) {
sscanf(chunk + 1, "%02hhX", chunk);
memmove(chunk + 1, chunk + 3, strlen(chunk + 3) + 1);
}
@@ -108,9 +108,8 @@ static SQLHSTMT custom_prepare(struct odbc_obj *obj, void *data)
/* We use ^XX, instead of %XX because '%' is a special character in SQL */
snprintf(eptr, encodebuf + sizeof(encodebuf) - eptr, "^%02hhX", *vptr);
eptr += 3;
- vptr++;
} else {
- *eptr++ = *vptr++;
+ *eptr++ = *vptr;
}
}
if (eptr < encodebuf + sizeof(encodebuf)) {