diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-05-02 11:21:11 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-05-02 18:58:02 +0000 |
commit | fd2fc0d2a86f39d563720563555ca6319f8ab223 (patch) | |
tree | 9786f60e75c6a8aafae976bc8b95d8835555585a /src/core/ozone/gl_surface_qt.cpp | |
parent | 726cefe2063c5d795d8333fcfd96ca759bbf5eb2 (diff) |
Fix read-after-free on EGL extensions
Cache the read extensions as an std::string, since the returned C string
may be not be permanent.
Pick-to: 6.3 6.2 5.15
Change-Id: I856b2b784ab4027da25996b2bf741b30cda10e05
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/core/ozone/gl_surface_qt.cpp')
-rw-r--r-- | src/core/ozone/gl_surface_qt.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/ozone/gl_surface_qt.cpp b/src/core/ozone/gl_surface_qt.cpp index 7110a00df..e05c198d8 100644 --- a/src/core/ozone/gl_surface_qt.cpp +++ b/src/core/ozone/gl_surface_qt.cpp @@ -64,8 +64,8 @@ namespace gl { void *GLSurfaceQt::g_display = nullptr; void *GLSurfaceQt::g_config = nullptr; -const char *GLSurfaceQt::g_client_extensions = nullptr; -const char *GLSurfaceQt::g_extensions = nullptr; +std::string GLSurfaceQt::g_client_extensions; +std::string GLSurfaceQt::g_extensions; GLSurfaceQt::~GLSurfaceQt() { @@ -86,7 +86,7 @@ GLSurfaceQt::GLSurfaceQt(const gfx::Size& size) bool GLSurfaceQt::HasEGLExtension(const char* name) { - return ExtensionsContain(g_extensions, name); + return ExtensionsContain(g_extensions.c_str(), name); } bool GLSurfaceQt::IsOffscreen() |