Skip to content

Commit f791fef

Browse files
author
Daniel Kroening
authored
Merge pull request #939 from reuk/str-refine-use-after-free
Fix use-after-free bugs in string refinement
2 parents 05d1ec6 + 539db25 commit f791fef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/goto-programs/string_refine_preprocess.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ void string_refine_preprocesst::make_string_function(
755755
code_function_callt &function_call=to_code_function_call(target->code);
756756
code_typet function_type=to_code_type(function_call.function().type());
757757
code_typet new_type;
758-
const source_locationt &loc=function_call.source_location();
758+
const source_locationt loc=function_call.source_location();
759759
declare_function(function_name, function_type);
760760
function_application_exprt rhs;
761761
std::vector<exprt> args;
@@ -1074,7 +1074,8 @@ void string_refine_preprocesst::replace_string_calls(
10741074
{
10751075
if(target->is_function_call())
10761076
{
1077-
code_function_callt &function_call=to_code_function_call(target->code);
1077+
const code_function_callt function_call=
1078+
to_code_function_call(target->code);
10781079

10791080
if(function_call.function().id()==ID_symbol)
10801081
{

0 commit comments

Comments
 (0)