提交 95d4d003 authored 作者: Michael Jerris's avatar Michael Jerris

don't set variable we don't use, and fix off by 1 buffer overflow in 1 case

上级 dbaf4992
...@@ -372,7 +372,7 @@ static switch_status_t de_say_money(switch_core_session_t *session, char *tosay, ...@@ -372,7 +372,7 @@ static switch_status_t de_say_money(switch_core_session_t *session, char *tosay,
char *dollars = NULL; char *dollars = NULL;
char *cents = NULL; char *cents = NULL;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
...@@ -400,7 +400,7 @@ static switch_status_t en_say_money(switch_say_file_handle_t *sh, char *tosay, s ...@@ -400,7 +400,7 @@ static switch_status_t en_say_money(switch_say_file_handle_t *sh, char *tosay, s
char *dollars = NULL; char *dollars = NULL;
char *cents = NULL; char *cents = NULL;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
...@@ -365,7 +365,7 @@ static switch_status_t es_say_money(switch_core_session_t *session, char *tosay, ...@@ -365,7 +365,7 @@ static switch_status_t es_say_money(switch_core_session_t *session, char *tosay,
char *dollars = NULL; char *dollars = NULL;
char *cents = NULL; char *cents = NULL;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
...@@ -423,7 +423,7 @@ static switch_status_t fa_say_money(switch_core_session_t *session, char *tosay, ...@@ -423,7 +423,7 @@ static switch_status_t fa_say_money(switch_core_session_t *session, char *tosay,
char *rials = NULL; char *rials = NULL;
char *cents = NULL; char *cents = NULL;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
/* valid characters are 0 - 9, period (.), minus (-), and plus (+) - remove all others */ /* valid characters are 0 - 9, period (.), minus (-), and plus (+) - remove all others */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
......
...@@ -402,7 +402,7 @@ static switch_status_t fr_say_money(switch_core_session_t *session, char *tosay, ...@@ -402,7 +402,7 @@ static switch_status_t fr_say_money(switch_core_session_t *session, char *tosay,
char *dollars = NULL; char *dollars = NULL;
char *cents = NULL; char *cents = NULL;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
...@@ -560,7 +560,7 @@ static switch_status_t he_say_money(switch_say_file_handle_t *sh, char *tosay, s ...@@ -560,7 +560,7 @@ static switch_status_t he_say_money(switch_say_file_handle_t *sh, char *tosay, s
char *cents = NULL; char *cents = NULL;
int icents = 0; int icents = 0;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
...@@ -358,7 +358,7 @@ static switch_status_t hu_say_money(switch_core_session_t *session, char *tosay, ...@@ -358,7 +358,7 @@ static switch_status_t hu_say_money(switch_core_session_t *session, char *tosay,
char sbuf[16] = ""; char sbuf[16] = "";
char *forint; char *forint;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
...@@ -441,7 +441,7 @@ static switch_status_t it_say_money(switch_core_session_t *session, char *tosay, ...@@ -441,7 +441,7 @@ static switch_status_t it_say_money(switch_core_session_t *session, char *tosay,
char *dollars = NULL; char *dollars = NULL;
char *cents = NULL; char *cents = NULL;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
...@@ -402,7 +402,7 @@ static switch_status_t ja_say_money(switch_core_session_t *session, char *tosay, ...@@ -402,7 +402,7 @@ static switch_status_t ja_say_money(switch_core_session_t *session, char *tosay,
char *dollars = NULL; char *dollars = NULL;
char *cents = NULL; char *cents = NULL;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
...@@ -322,7 +322,7 @@ static switch_status_t nl_say_money(switch_core_session_t *session, char *tosay, ...@@ -322,7 +322,7 @@ static switch_status_t nl_say_money(switch_core_session_t *session, char *tosay,
char *dollars = NULL; char *dollars = NULL;
char *cents = NULL; char *cents = NULL;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
...@@ -420,7 +420,7 @@ static switch_status_t pl_say_money(switch_say_file_handle_t *sh, char *tosay, s ...@@ -420,7 +420,7 @@ static switch_status_t pl_say_money(switch_say_file_handle_t *sh, char *tosay, s
char *dollars = NULL; char *dollars = NULL;
char *cents = NULL; char *cents = NULL;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
...@@ -426,7 +426,7 @@ static switch_status_t pt_say_money(switch_core_session_t *session, char *tosay, ...@@ -426,7 +426,7 @@ static switch_status_t pt_say_money(switch_core_session_t *session, char *tosay,
char *dollars = NULL; char *dollars = NULL;
char *cents = NULL; char *cents = NULL;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
...@@ -273,7 +273,7 @@ static switch_status_t ru_say_money(switch_say_file_handle_t *sh, char *tosay, s ...@@ -273,7 +273,7 @@ static switch_status_t ru_say_money(switch_say_file_handle_t *sh, char *tosay, s
int ikopeck = 0; int ikopeck = 0;
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " ru_say_money %s say_opt->currency=%d\n", tosay,say_opt->currency); // switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " ru_say_money %s say_opt->currency=%d\n", tosay,say_opt->currency);
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
...@@ -454,7 +454,7 @@ static switch_status_t sv_say_money(switch_say_file_handle_t *sh, char *tosay, s ...@@ -454,7 +454,7 @@ static switch_status_t sv_say_money(switch_say_file_handle_t *sh, char *tosay, s
char *dollars = NULL; char *dollars = NULL;
char *cents = NULL; char *cents = NULL;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
...@@ -424,7 +424,7 @@ static switch_status_t th_say_money(switch_core_session_t *session, char *tosay, ...@@ -424,7 +424,7 @@ static switch_status_t th_say_money(switch_core_session_t *session, char *tosay,
char *dollars = NULL; char *dollars = NULL;
char *cents = NULL; char *cents = NULL;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
...@@ -388,7 +388,7 @@ static switch_status_t zh_say_money(switch_core_session_t *session, char *tosay, ...@@ -388,7 +388,7 @@ static switch_status_t zh_say_money(switch_core_session_t *session, char *tosay,
char *dollars = NULL; char *dollars = NULL;
char *cents = NULL; char *cents = NULL;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
...@@ -436,7 +436,7 @@ static switch_status_t zh_CN_say_money(switch_core_session_t *session, char *tos ...@@ -436,7 +436,7 @@ static switch_status_t zh_CN_say_money(switch_core_session_t *session, char *tos
char *rest = NULL; char *rest = NULL;
int i; int i;
if (strlen(tosay) > 15 || !(tosay = switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1))) { if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论