Skip to content

Commit f9a625e

Browse files
committedMar 11, 2025
Add trusted content notes to QOpenGLShader(Program)
Pick-to: 6.9 6.8 Change-Id: I089044e6834ebbb992b36c898eb956959f430522 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
1 parent 8612bd8 commit f9a625e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
 

‎src/opengl/qopenglshaderprogram.cpp

+20
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ using namespace Qt::StringLiterals;
110110
they advertise the extension or offer OpenGL ES 3.0. In this case program
111111
binary support will be disabled.
112112
113+
\section1 Security Considerations
114+
115+
All data consumed by QOpenGLShaderProgram is expected to be trusted content.
116+
Shader source code is passed, possibly after minimal modifications, on to
117+
the underlying OpenGL implementation's compiler, which is a black box from
118+
Qt's perspective.
119+
120+
\warning Application developers are advised to carefully consider the
121+
potential implications before passing in user-provided content to functions
122+
such as addShaderFromSourceFile().
123+
113124
\sa QOpenGLShader
114125
*/
115126

@@ -126,6 +137,15 @@ using namespace Qt::StringLiterals;
126137
QOpenGLShader and QOpenGLShaderProgram shelter the programmer from the details of
127138
compiling and linking vertex and fragment shaders.
128139
140+
All data consumed by QOpenGLShader is expected to be trusted content. Shader
141+
source code is passed, possibly after minimal modifications, on to the
142+
underlying OpenGL implementation's compiler, which is a black box from Qt's
143+
perspective.
144+
145+
\warning Application developers are advised to carefully consider the
146+
potential implications before passing in user-provided content to functions
147+
such as compileSourceFile().
148+
129149
\sa QOpenGLShaderProgram
130150
*/
131151

0 commit comments

Comments
 (0)