msvcp: Fixed uninitialized variable access in num_get::_Getffld and _Getifld functions.

This commit is contained in:
Piotr Caban 2012-11-07 15:15:29 +01:00 committed by Alexandre Julliard
parent 654a3ec500
commit 605ea64985
4 changed files with 56 additions and 80 deletions

View File

@ -3926,12 +3926,10 @@ static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator
if(sep && groups_no)
MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
groups = MSVCP_basic_string_char_c_str(&groups_found);
if(cur_group && !groups[cur_group])
{
error = TRUE; /* trailing empty */
}else if(!cur_group) /* no groups, skip loop */
if(!cur_group) /* no groups, skip loop */
cur_group--;
else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group])
error = TRUE; /* trailing empty */
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {
@ -4069,13 +4067,12 @@ static int num_get__Getifld(const num_get *this, char *dest, istreambuf_iterator
if(sep && groups_no)
MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
groups = MSVCP_basic_string_char_c_str(&groups_found);
if(cur_group && !groups[cur_group])
{
if(!cur_group) { /* no groups, skip loop */
cur_group--;
}else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) {
error = TRUE; /* trailing empty */
found_zero = FALSE;
}else if(!cur_group) /* no groups, skip loop */
cur_group--;
}
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {
@ -5020,12 +5017,10 @@ static int num_get_char__Getffld(const num_get *this, char *dest, istreambuf_ite
if(sep && groups_no)
MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
groups = MSVCP_basic_string_char_c_str(&groups_found);
if(cur_group && !groups[cur_group])
{
error = TRUE; /* trailing empty */
}else if(!cur_group) /* no groups, skip loop */
if(!cur_group) /* no groups, skip loop */
cur_group--;
else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group])
error = TRUE; /* trailing empty */
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {
@ -5160,13 +5155,12 @@ int __cdecl num_get_char__Getifld(const num_get *this, char *dest, istreambuf_it
if(sep && groups_no)
MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
groups = MSVCP_basic_string_char_c_str(&groups_found);
if(cur_group && !groups[cur_group])
{
if(!cur_group) { /* no groups, skip loop */
cur_group--;
}else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) {
error = TRUE; /* trailing empty */
found_zero = FALSE;
}else if(!cur_group) /* no groups, skip loop */
cur_group--;
}
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {

View File

@ -4076,12 +4076,10 @@ static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator
if(sep && groups_no)
basic_string_char_append_ch(&groups_found, groups_no);
groups = basic_string_char_c_str(&groups_found);
if(cur_group && !groups[cur_group])
{
error = TRUE; /* trailing empty */
}else if(!cur_group) /* no groups, skip loop */
if(!cur_group) /* no groups, skip loop */
cur_group--;
else if(!(groups = basic_string_char_c_str(&groups_found))[cur_group])
error = TRUE; /* trailing empty */
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {
@ -4208,13 +4206,12 @@ static int num_get__Getifld(const num_get *this, char *dest, istreambuf_iterator
if(sep && groups_no)
basic_string_char_append_ch(&groups_found, groups_no);
groups = basic_string_char_c_str(&groups_found);
if(cur_group && groups && !groups[cur_group])
{
if(!cur_group) { /* no groups, skip loop */
cur_group--;
}else if(!(groups = basic_string_char_c_str(&groups_found))[cur_group]) {
error = TRUE; /* trailing empty */
found_zero = FALSE;
}else if(!cur_group) /* no groups, skip loop */
cur_group--;
}
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {
@ -5138,12 +5135,10 @@ static int num_get_char__Getffld(const num_get *this, char *dest, istreambuf_ite
if(sep && groups_no)
basic_string_char_append_ch(&groups_found, groups_no);
groups = basic_string_char_c_str(&groups_found);
if(cur_group && !groups[cur_group])
{
error = TRUE; /* trailing empty */
}else if(!cur_group) /* no groups, skip loop */
if(!cur_group) /* no groups, skip loop */
cur_group--;
else if(!(groups = basic_string_char_c_str(&groups_found))[cur_group])
error = TRUE; /* trailing empty */
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {
@ -5269,13 +5264,12 @@ static int num_get_char__Getifld(const num_get *this, char *dest, istreambuf_ite
if(sep && groups_no)
basic_string_char_append_ch(&groups_found, groups_no);
groups = basic_string_char_c_str(&groups_found);
if(cur_group && groups && !groups[cur_group])
{
if(!cur_group) { /* no groups, skip loop */
cur_group--;
}else if(!(groups = basic_string_char_c_str(&groups_found))[cur_group]) {
error = TRUE; /* trailing empty */
found_zero = FALSE;
}else if(!cur_group) /* no groups, skip loop */
cur_group--;
}
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {

View File

@ -4344,12 +4344,10 @@ static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator
if(sep && groups_no)
MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
groups = MSVCP_basic_string_char_c_str(&groups_found);
if(cur_group && !groups[cur_group])
{
error = TRUE; /* trailing empty */
}else if(!cur_group) /* no groups, skip loop */
if(!cur_group) /* no groups, skip loop */
cur_group--;
else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group])
error = TRUE; /* trailing empty */
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {
@ -4492,13 +4490,12 @@ static int num_get__Getifld(const num_get *this, char *dest, istreambuf_iterator
if(sep && groups_no)
MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
groups = MSVCP_basic_string_char_c_str(&groups_found);
if(cur_group && !groups[cur_group])
{
if(!cur_group) { /* no groups, skip loop */
cur_group--;
}else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) {
error = TRUE; /* trailing empty */
found_zero = FALSE;
}else if(!cur_group) /* no groups, skip loop */
cur_group--;
}
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {
@ -5432,12 +5429,10 @@ int __cdecl num_get_char__Getffld(const num_get *this, char *dest, istreambuf_it
if(sep && groups_no)
MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
groups = MSVCP_basic_string_char_c_str(&groups_found);
if(cur_group && !groups[cur_group])
{
error = TRUE; /* trailing empty */
}else if(!cur_group) /* no groups, skip loop */
if(!cur_group) /* no groups, skip loop */
cur_group--;
else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group])
error = TRUE; /* trailing empty */
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {
@ -5563,13 +5558,12 @@ int __cdecl num_get_char__Getifld(const num_get *this, char *dest, istreambuf_it
if(sep && groups_no)
MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
groups = MSVCP_basic_string_char_c_str(&groups_found);
if(cur_group && !groups[cur_group])
{
if(!cur_group) { /* no groups, skip loop */
cur_group--;
}else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) {
error = TRUE; /* trailing empty */
found_zero = FALSE;
}else if(!cur_group) /* no groups, skip loop */
cur_group--;
}
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {

View File

@ -4526,12 +4526,10 @@ static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator
if(sep && groups_no)
MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
groups = MSVCP_basic_string_char_c_str(&groups_found);
if(cur_group && !groups[cur_group])
{
error = TRUE; /* trailing empty */
}else if(!cur_group) /* no groups, skip loop */
if(!cur_group) /* no groups, skip loop */
cur_group--;
else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group])
error = TRUE; /* trailing empty */
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {
@ -4685,13 +4683,12 @@ static int num_get__Getifld(const num_get *this, char *dest, istreambuf_iterator
if(sep && groups_no)
MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
groups = MSVCP_basic_string_char_c_str(&groups_found);
if(cur_group && !groups[cur_group])
{
if(!cur_group) { /* no groups, skip loop */
cur_group--;
}else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) {
error = TRUE; /* trailing empty */
found_zero = FALSE;
}else if(!cur_group) /* no groups, skip loop */
cur_group--;
}
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {
@ -5636,12 +5633,10 @@ int __cdecl num_get_char__Getffld(const num_get *this, char *dest, istreambuf_it
if(sep && groups_no)
MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
groups = MSVCP_basic_string_char_c_str(&groups_found);
if(cur_group && !groups[cur_group])
{
error = TRUE; /* trailing empty */
}else if(!cur_group) /* no groups, skip loop */
if(!cur_group) /* no groups, skip loop */
cur_group--;
else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group])
error = TRUE; /* trailing empty */
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {
@ -5776,13 +5771,12 @@ int __cdecl num_get_char__Getifld(const num_get *this, char *dest, istreambuf_it
if(sep && groups_no)
MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
groups = MSVCP_basic_string_char_c_str(&groups_found);
if(cur_group && !groups[cur_group])
{
if(!cur_group) { /* no groups, skip loop */
cur_group--;
}else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) {
error = TRUE; /* trailing empty */
found_zero = FALSE;
}else if(!cur_group) /* no groups, skip loop */
cur_group--;
}
for(; cur_group>=0 && !error; cur_group--) {
if(*grouping == CHAR_MAX) {