Skip to content

Commit 25c9790

Browse files
garimaguromanovvlad
authored andcommitted
[SYCL] Check if PluginInitializeFunction is NULL before accessing it. (#963)
Signed-off-by: Garima Gupta <[email protected]>
1 parent 118dc82 commit 25c9790

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sycl/source/detail/pi.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ bool bindPlugin(void *Library) {
7979

8080
decltype(::piPluginInit) *PluginInitializeFunction = (decltype(
8181
&::piPluginInit))(getOsLibraryFuncAddress(Library, "piPluginInit"));
82+
if (PluginInitializeFunction == nullptr)
83+
return false;
84+
8285
int err = PluginInitializeFunction(&PluginInformation);
8386

8487
// TODO: Compare Supported versions and check for backward compatibility.

0 commit comments

Comments
 (0)