Flagged by cppcheck 1.64: [glamor/glamor_core.c:536] -> [glamor/glamor_core.c:540]: (warning) Possible null pointer dereference: extension - otherwise it is redundant to check it against null. [glamor/glamor_egl.c:620] -> [glamor/glamor_egl.c:622]: (warning) Possible null pointer dereference: extension - otherwise it is redundant to check it against null.
Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> --- glamor/glamor_core.c | 4 ++-- glamor/glamor_egl.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c index 5883809..e01ca84 100644 --- a/glamor/glamor_core.c +++ b/glamor/glamor_core.c @@ -533,13 +533,13 @@ glamor_gl_has_extension(const char *extension) const char *pext; int ext_len; - ext_len = strlen(extension); - pext = (const char *) glGetString(GL_EXTENSIONS); if (pext == NULL || extension == NULL) return FALSE; + ext_len = strlen(extension); + while ((pext = strstr(pext, extension)) != NULL) { if (pext[ext_len] == ' ' || pext[ext_len] == '\0') return TRUE; diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index 05e6bd0..60f8dae 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -617,10 +617,10 @@ glamor_egl_has_extension(struct glamor_egl_screen_private *glamor_egl, const char *pext; int ext_len; - ext_len = strlen(extension); pext = (const char *) eglQueryString(glamor_egl->display, EGL_EXTENSIONS); if (pext == NULL || extension == NULL) return FALSE; + ext_len = strlen(extension); while ((pext = strstr(pext, extension)) != NULL) { if (pext[ext_len] == ' ' || pext[ext_len] == '\0') return TRUE; -- 1.7.9.2 _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel