Skip to content

Commit 27cc90f

Browse files
addaleaxruyadorno
authored andcommitted
build: fix C string encoding for PRODUCT_DIR_ABS
Since the `PRODUCT_DIR_ABS` gyp variable is meant to be used in a C string in the OpenSSL config, provide a version of it that actually provides it in a way that is always usable as a C string. Otherwise, unescaped characters in the path can mess with the string definitions; for example, building in paths on Windows whose directories start with valid or invalid escape sequences (e.g.: `C:\...\x61foobar\...` or `C:\...\456789\...`) can result in failing builds or incorrect paths provided to OpenSSL. PR-URL: #56111 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 98ea499 commit 27cc90f

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

deps/openssl/openssl.gyp

+3-9
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,13 @@
55
'nasm_version%': '0.0',
66
'openssl-cli': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)openssl-cli<(EXECUTABLE_SUFFIX)',
77
'conditions': [
8-
['OS == "win"', {
9-
'obj_dir_abs': '<(PRODUCT_DIR_ABS)/obj',
10-
}],
118
['GENERATOR == "ninja"', {
12-
'obj_dir_abs': '<(PRODUCT_DIR_ABS)/obj',
13-
'modules_dir': '<(PRODUCT_DIR_ABS)/obj/lib/openssl-modules',
9+
'modules_dir': '<(PRODUCT_DIR_ABS_CSTR)/obj/lib/openssl-modules',
1410
}, {
15-
'obj_dir_abs%': '<(PRODUCT_DIR_ABS)/obj.target',
16-
'modules_dir': '<(PRODUCT_DIR_ABS)/obj.target/deps/openssl/lib/openssl-modules',
11+
'modules_dir': '<(PRODUCT_DIR_ABS_CSTR)/obj.target/deps/openssl/lib/openssl-modules',
1712
}],
1813
['OS=="mac"', {
19-
'obj_dir_abs%': '<(PRODUCT_DIR_ABS)/obj.target',
20-
'modules_dir': '<(PRODUCT_DIR_ABS)/obj.target/deps/openssl/lib/openssl-modules',
14+
'modules_dir': '<(PRODUCT_DIR_ABS_CSTR)/obj.target/deps/openssl/lib/openssl-modules',
2115
}],
2216
],
2317
},

0 commit comments

Comments
 (0)