diff options
| author | Xavier Roche <xroche@users.noreply.github.com> | 2014-05-02 15:13:29 +0000 |
|---|---|---|
| committer | Xavier Roche <xroche@users.noreply.github.com> | 2014-05-02 15:13:29 +0000 |
| commit | 5544f503bf0fcfd050b4e338e8ec7b22e2f53b9a (patch) | |
| tree | 2d65f1fd285c450cbb1c676697ad13b5a47a835c /src/htsindex.c | |
| parent | b3fa8537c411e6e2d53044b1d5d20c361d2ad17d (diff) | |
Big cleanup in functions writing to a char buffer without proper size boundary.
Diffstat (limited to 'src/htsindex.c')
| -rw-r--r-- | src/htsindex.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/htsindex.c b/src/htsindex.c index 4055ca6..1d08012 100644 --- a/src/htsindex.c +++ b/src/htsindex.c @@ -161,8 +161,8 @@ int index_keyword(const char *html_data, LLint size, const char *mime, // Init ? if (hts_index_init) { - UNLINK(concat(catbuff, indexpath, "index.txt")); - UNLINK(concat(catbuff, indexpath, "sindex.html")); + UNLINK(concat(catbuff, sizeof(catbuff), indexpath, "index.txt")); + UNLINK(concat(catbuff, sizeof(catbuff), indexpath, "sindex.html")); hts_index_init = 0; } // Check MIME type @@ -291,7 +291,7 @@ int index_keyword(const char *html_data, LLint size, const char *mime, e++; /* 0 means "once" */ - if (strncmp((const char *) fslash(catbuff, (char *) indexpath), filename, strlen(indexpath)) == 0) // couper + if (strncmp((const char *) fslash(catbuff, sizeof(catbuff), (char *) indexpath), filename, strlen(indexpath)) == 0) // couper strcpybuff(savelst, filename + strlen(indexpath)); else strcpybuff(savelst, filename); @@ -358,9 +358,9 @@ void index_finish(const char *indexpath, int mode) { // Write new file if (mode == 1) // TEXT - fp = fopen(concat(catbuff, indexpath, "index.txt"), "wb"); + fp = fopen(concat(catbuff, sizeof(catbuff), indexpath, "index.txt"), "wb"); else // HTML - fp = fopen(concat(catbuff, indexpath, "sindex.html"), "wb"); + fp = fopen(concat(catbuff, sizeof(catbuff), indexpath, "sindex.html"), "wb"); if (fp) { char current_word[KEYW_LEN + 32]; char word[KEYW_LEN + 32]; |
