Navigation Menu

Skip to content

Commit

Permalink
Eliminate the possibility of buffer overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kenhys committed Jun 27, 2012
1 parent 8c1c6c4 commit 4cca9e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/mrn_path_mapper.cpp
Expand Up @@ -48,9 +48,10 @@ namespace mrn {
return db_path_;
}

size_t db_len = strlen(db_path_);
if (strncmp(mysql_path_, "./", 2) == 0) {
if (path_prefix_) {
strncat(db_path_, path_prefix_, MRN_MAX_PATH_SIZE);
strncat(db_path_, path_prefix_, MRN_MAX_PATH_SIZE - db_len - 1);
}

int i = 2, j = strlen(db_path_), len;
Expand Down

0 comments on commit 4cca9e5

Please sign in to comment.