[Scummvm-git-logs] scummvm master -> eb3aa0077a97659850765ac357c2c4214fe661c7

mduggan noreply at scummvm.org
Fri Feb 3 12:47:04 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
eb3aa0077a TINYGL: Fix potential buffer overflow in glMaterialfv


Commit: eb3aa0077a97659850765ac357c2c4214fe661c7
    https://github.com/scummvm/scummvm/commit/eb3aa0077a97659850765ac357c2c4214fe661c7
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-02-03T21:41:53+09:00

Commit Message:
TINYGL: Fix potential buffer overflow in glMaterialfv

When setting GL_SHININESS via glMaterialfv, the pointer only points to a single
value. Don't read past that.

Reported in github.com/C-Chads/tinygl/pull/20

Changed paths:
    graphics/tinygl/api.cpp


diff --git a/graphics/tinygl/api.cpp b/graphics/tinygl/api.cpp
index 164801ef2f1..170179d524f 100644
--- a/graphics/tinygl/api.cpp
+++ b/graphics/tinygl/api.cpp
@@ -498,7 +498,7 @@ void tglMaterialfv(TGLenum mode, TGLenum type, const TGLfloat *v) {
 	n = 4;
 	if (type == TGL_SHININESS)
 		n = 1;
-	for (int i = 0; i < 4; i++)
+	for (int i = 0; i < n; i++)
 		p[3 + i].f = v[i];
 	for (int i = n; i < 4; i++)
 		p[3 + i].f = 0;




More information about the Scummvm-git-logs mailing list