]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use strlcpy for strings, not memcpy
authorAlan T. DeKok <aland@freeradius.org>
Wed, 20 May 2015 17:51:50 +0000 (13:51 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 20 May 2015 17:51:50 +0000 (13:51 -0400)
src/modules/rlm_python/rlm_python.c

index 43b51b412c0bb25357d4fcdf96c3ad81303e6fc8..3f52b87165fdadbf22f09e7605d00c04681af91f 100644 (file)
@@ -223,9 +223,9 @@ static int mod_init(rlm_python_t *inst)
        inst->main_thread_state = PyThreadState_Get();  /* We need this for setting up thread local stuff */
 #endif
        if (inst->python_path) {
-               char *path;
+               char path[4096];
 
-               memcpy(&path, &inst->python_path, sizeof(path));
+               strlcpy(path, inst->python_path, sizeof(path));
                PySys_SetPath(path);
        }