OSDN Git Service

glapi: s/strcpy/strncpy/
authorVinson Lee <vlee@vmware.com>
Sat, 1 May 2010 22:34:47 +0000 (15:34 -0700)
committerVinson Lee <vlee@vmware.com>
Sat, 1 May 2010 22:34:47 +0000 (15:34 -0700)
src/mesa/glapi/glapi_getproc.c

index c73e8dd..ec96ab3 100644 (file)
@@ -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;
 }