Ian Romanick wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Vinson Lee wrote:
Module: Mesa
Branch: master
Commit: 9446fd8f69564e09ffd0f28735a99c510f84bb62
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9446fd8f69564e09ffd0f28735a99c510f84bb62
Author: Vinson Lee <v...@vmware.com>
Date: Sat May 1 15:34:47 2010 -0700
glapi: s/strcpy/strncpy/
---
src/mesa/glapi/glapi_getproc.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/mesa/glapi/glapi_getproc.c b/src/mesa/glapi/glapi_getproc.c
index c73e8dd..ec96ab3 100644
--- a/src/mesa/glapi/glapi_getproc.c
+++ b/src/mesa/glapi/glapi_getproc.c
@@ -265,7 +265,8 @@ str_dup(const char *str)
copy = (char*) malloc(strlen(str) + 1);
if (!copy)
return NULL;
- strcpy(copy, str);
+ strncpy(copy, str, strlen(str));
+ copy[strlen(str)] = '\0';
return copy;
}
Is this commit real, or a joke? April 1st was a long time ago. This
change converts a call to strcpy to an open-coded version of strcpy
using strncpy.
NAK. This makes the code worse by any serious measure. Please revert.
I've reverted it.
-Brian
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev