diff options
author | Nirbhay Choubey <nirbhay.choubey@oracle.com> | 2013-01-04 16:42:49 +0530 |
---|---|---|
committer | Nirbhay Choubey <nirbhay.choubey@oracle.com> | 2013-01-04 16:42:49 +0530 |
commit | 31a720abbdc27ddaa0f2379393cb0c6cf5e30181 (patch) | |
tree | 7ef3591f1f821f3b410994e0a8a646ac8eaa66cb /mysys/my_lib.c | |
parent | dd36a80f655be71d4c6a15fd9ddbb98dc0f273f2 (diff) | |
parent | 1ef420b8d4a160a6e1a1a7e8f4dee5f85d2c80d5 (diff) | |
download | mariadb-git-31a720abbdc27ddaa0f2379393cb0c6cf5e30181.tar.gz |
Merge of patch for bug#16066243 from mysql-5.1.
Diffstat (limited to 'mysys/my_lib.c')
-rw-r--r-- | mysys/my_lib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mysys/my_lib.c b/mysys/my_lib.c index b42a3d55d93..f178d75734a 100644 --- a/mysys/my_lib.c +++ b/mysys/my_lib.c @@ -96,7 +96,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags) MEM_ROOT *names_storage; DIR *dirp; struct dirent *dp; - char tmp_path[FN_REFLEN+1],*tmp_file; + char tmp_path[FN_REFLEN + 2], *tmp_file; char dirent_tmp[sizeof(struct dirent)+_POSIX_PATH_MAX+1]; DBUG_ENTER("my_dir"); @@ -197,10 +197,11 @@ char * directory_file_name (char * dst, const char *src) { /* Process as Unix format: just remove test the final slash. */ char *end; + DBUG_ASSERT(strlen(src) < (FN_REFLEN + 1)); if (src[0] == 0) src= (char*) "."; /* Use empty as current */ - end=strmov(dst, src); + end= strnmov(dst, src, FN_REFLEN + 1); if (end[-1] != FN_LIBCHAR) { end[0]=FN_LIBCHAR; /* Add last '/' */ |