xmllite: Add Unknown to map (Coverity)

Nikolay Sivov bunglehead at gmail.com
Mon Jan 30 22:17:32 CST 2017


On 31.01.2017 1:11, André Hentschel wrote:
> CID 1364307
> 
> Signed-off-by: André Hentschel <nerv at dawncrow.de>
> ---
>  dlls/xmllite/reader.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/dlls/xmllite/reader.c b/dlls/xmllite/reader.c
> index 1e3c7aa..f99ea66 100644
> --- a/dlls/xmllite/reader.c
> +++ b/dlls/xmllite/reader.c
> @@ -85,6 +85,7 @@ typedef enum
>  
>  static const WCHAR utf16W[] = {'U','T','F','-','1','6',0};
>  static const WCHAR utf8W[] = {'U','T','F','-','8',0};
> +static const WCHAR unknownW[] = {'U','n','k','n','o','w','n',0};
>  
>  static const WCHAR dblquoteW[] = {'\"',0};
>  static const WCHAR quoteW[] = {'\'',0};
> @@ -151,8 +152,9 @@ struct xml_encoding_data
>  };
>  
>  static const struct xml_encoding_data xml_encoding_map[] = {
> -    { utf16W, XmlEncoding_UTF16, ~0 },
> -    { utf8W,  XmlEncoding_UTF8,  CP_UTF8 }
> +    { utf16W,   XmlEncoding_UTF16,      ~0 },
> +    { utf8W,    XmlEncoding_UTF8,       CP_UTF8 },
> +    { unknownW, XmlEncoding_Unknown,    ~0 },
>  };
>  
>  const WCHAR *get_encoding_name(xml_encoding encoding)
> 

I don't think this fixes anything in a sense of making xmllite more
compliant. We probably should just fail at
CreateXmlWriterOutputWithEncodingName() and print encoding string that
made it fail.



More information about the wine-devel mailing list