aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-07-19 11:46:23 +0200
committerJohn Högberg <[email protected]>2018-09-13 09:02:30 +0200
commitffa54a25e1cc9c6d0b93dcd3a84ae9c8962ff7ec (patch)
tree6b9887aa139fd55267d30108fb893116b654d63b
parent72a9c61b043dd12b6871248b6b353b333b1bc30b (diff)
downloadotp-ffa54a25e1cc9c6d0b93dcd3a84ae9c8962ff7ec.tar.gz
otp-ffa54a25e1cc9c6d0b93dcd3a84ae9c8962ff7ec.tar.bz2
otp-ffa54a25e1cc9c6d0b93dcd3a84ae9c8962ff7ec.zip
Fix unsafe use of lists:reverse/1
We said reverse/2 but used reverse/1 which is unsafe to use in preloaded modules. This didn't have any effect in practice as the affected functions weren't used before the code server was started, but it's still an error.
-rw-r--r--erts/preloaded/ebin/prim_file.beambin27800 -> 27780 bytes
-rw-r--r--erts/preloaded/src/prim_file.erl2
2 files changed, 1 insertions, 1 deletions
diff --git a/erts/preloaded/ebin/prim_file.beam b/erts/preloaded/ebin/prim_file.beam
index 3316e4348c..df611f2bb0 100644
--- a/erts/preloaded/ebin/prim_file.beam
+++ b/erts/preloaded/ebin/prim_file.beam
Binary files differ
diff --git a/erts/preloaded/src/prim_file.erl b/erts/preloaded/src/prim_file.erl
index 517ca74301..6d85868183 100644
--- a/erts/preloaded/src/prim_file.erl
+++ b/erts/preloaded/src/prim_file.erl
@@ -786,7 +786,7 @@ altname_nif(_Path) ->
%% We know for certain that lists:reverse/2 is a BIF, so it's safe to use it
%% even though this module is preloaded.
-reverse_list(List) -> lists:reverse(List).
+reverse_list(List) -> lists:reverse(List, []).
proplist_get_value(_Key, [], Default) ->
Default;