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

Commit

Permalink
fix tmp string length
Browse files Browse the repository at this point in the history
	closes #165
  • Loading branch information
jpmens committed Oct 13, 2016
1 parent c840e6d commit 3895910
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions be-mongo.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ char *be_mongo_getuser(void *handle, const char *username, const char *password,
bson_iter_find(&iter, conf->password_loc);

char *src = (char *)bson_iter_utf8(&iter, NULL);
size_t tmp = strlen(src);
size_t tmp = strlen(src) + 1;
result = (char *) malloc(tmp);
memset(result, 0, tmp);
memcpy(result, src, tmp);
memcpy(result, src, tmp);
}
}

Expand Down

0 comments on commit 3895910

Please sign in to comment.