egl/glvnd: Fix a segfault in eglGetProcAddress.
authorKyle Brenneman <kbrenneman@nvidia.com>
Wed, 6 Jun 2018 15:08:47 +0000 (09:08 -0600)
committerEric Engestrom <eric.engestrom@intel.com>
Mon, 11 Jun 2018 11:17:07 +0000 (12:17 +0100)
commit41642bdbca007035772fbfdc311f14daa5510d5d
tree287042074c5b35edb0fefbd49853e9151e61bdfa
parente266b320590ebbeadf7c98b0b493d89886534ccb
egl/glvnd: Fix a segfault in eglGetProcAddress.

If FindProcIndex in egldispatchstubs.c is called with a name that's less than
the first entry in the array, it would end up trying to store an index of -1 in
an unsigned integer, wrap around to 2^32, and then crash when it tries to look
that up.

Change FindProcIndex so that it uses bsearch(3) instead of implementing its own
binary search, like the GLX equivalent FindGLXFunction does.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
src/egl/main/egldispatchstubs.c