Skip to content
This repository was archived by the owner on Mar 12, 2019. It is now read-only.

Commit 3895910

Browse files
committed
fix tmp string length
closes #165
1 parent c840e6d commit 3895910

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

be-mongo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ char *be_mongo_getuser(void *handle, const char *username, const char *password,
156156
bson_iter_find(&iter, conf->password_loc);
157157

158158
char *src = (char *)bson_iter_utf8(&iter, NULL);
159-
size_t tmp = strlen(src);
159+
size_t tmp = strlen(src) + 1;
160160
result = (char *) malloc(tmp);
161161
memset(result, 0, tmp);
162-
memcpy(result, src, tmp);
162+
memcpy(result, src, tmp);
163163
}
164164
}
165165

0 commit comments

Comments
 (0)