Commit 605ea649 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

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

parent 654a3ec5
......@@ -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) {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment