libIDL/libIDL-0.8.14-lexer-sscanf-type-punning.patch
DistroBaker 8e92a6db78 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/libIDL.git#60e1b2a45ce0d63092c235448cee94175566cf74
2021-02-05 21:36:07 +00:00

37 lines
1.1 KiB
Diff

diff -Naur libIDL-0.8.14-original/lexer.l libIDL-0.8.14/lexer.l
--- libIDL-0.8.14-original/lexer.l 2009-04-18 08:20:37.000000000 -0400
+++ libIDL-0.8.14/lexer.l 2021-02-03 12:56:01.237822569 -0500
@@ -269,17 +269,29 @@
<*>{whitespace} ;
{b8_int} {
yylval.integer = 0;
- sscanf (yytext, "%" IDL_LL "o", &yylval.integer);
+ {
+ long long unsigned yyltmp = 0;
+ sscanf (yytext, "%" IDL_LL "o", &yyltmp);
+ memmove (&yylval.integer, &yyltmp, sizeof (yylval.integer));
+ }
tokreturn (TOK_INTEGER);
}
{b10_uint} {
yylval.integer = 0;
- sscanf (yytext, "%" IDL_LL "u", &yylval.integer);
+ {
+ long long unsigned yyltmp = 0;
+ sscanf (yytext, "%" IDL_LL "u", &yyltmp);
+ memmove (&yylval.integer, &yyltmp, sizeof (yylval.integer));
+ }
tokreturn (TOK_INTEGER);
}
{b16_int} {
yylval.integer = 0;
- sscanf (yytext + 2, "%" IDL_LL "x", &yylval.integer);
+ {
+ long long unsigned yyltmp = 0;
+ sscanf (yytext + 2, "%" IDL_LL "x", &yyltmp);
+ memmove (&yylval.integer, &yyltmp, sizeof (yylval.integer));
+ }
tokreturn (TOK_INTEGER);
}
{fixed_lit} {