Skip to content

Commit 2a51251

Browse files
authored
Merge pull request #5993 from dra27/harden
Harden OpamStd.Sys.check_dll
2 parents 945a14f + 6f7c4b4 commit 2a51251

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

master_changes.md

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ users)
127127

128128
## Internal: Windows
129129
* Set the console to use UTF-8 on Windows using SetConsoleCP and SetConsoleOutputCP [#5970 @kit-ty-kate]
130+
* Harden the CRLF stripping when using cygcheck [#5993 @dra27]
130131

131132
## Test
132133

src/core/opamStd.ml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,8 @@ module OpamSys = struct
12191219
let rec check_dll platform =
12201220
match input_line c with
12211221
| dll ->
1222-
let tdll = (*String.trim*) dll in
1222+
(* Guard against any risk of stray \r characters *)
1223+
let tdll = String.trim dll in
12231224
if OpamString.ends_with ~suffix:"cygwin1.dll" tdll then
12241225
if OpamString.starts_with ~prefix:" " dll then
12251226
check_dll `Cygwin

0 commit comments

Comments
 (0)