Skip to content

Commit

Permalink
Merge pull request #5993 from dra27/harden
Browse files Browse the repository at this point in the history
Harden OpamStd.Sys.check_dll
  • Loading branch information
dra27 authored Jun 6, 2024
2 parents 945a14f + 6f7c4b4 commit 2a51251
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ users)

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

## Test

Expand Down
3 changes: 2 additions & 1 deletion src/core/opamStd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,8 @@ module OpamSys = struct
let rec check_dll platform =
match input_line c with
| dll ->
let tdll = (*String.trim*) dll in
(* Guard against any risk of stray \r characters *)
let tdll = String.trim dll in
if OpamString.ends_with ~suffix:"cygwin1.dll" tdll then
if OpamString.starts_with ~prefix:" " dll then
check_dll `Cygwin
Expand Down

0 comments on commit 2a51251

Please sign in to comment.