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/htsserver.c | |
parent | b3fa8537c411e6e2d53044b1d5d20c361d2ad17d (diff) |
Big cleanup in functions writing to a char buffer without proper size boundary.
Diffstat (limited to 'src/htsserver.c')
-rw-r--r-- | src/htsserver.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/htsserver.c b/src/htsserver.c index 354917b..1388110 100644 --- a/src/htsserver.c +++ b/src/htsserver.c @@ -964,7 +964,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) { if (pos2 != NULL) { *pos2 = '\0'; if (strstr(name, "..") == NULL) { - if (fexist(fconcat(catbuff, path, name))) { + if (fexist(fconcat(catbuff, sizeof(catbuff), path, name))) { langstr = pos2 + 1; } } @@ -994,20 +994,20 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) { } } else if (strcmp(name, "if-file-exists") == 0) { if (strstr(pos2, "..") == NULL) { - if (!fexist(fconcat(catbuff, path, pos2))) { + if (!fexist(fconcat(catbuff, sizeof(catbuff), path, pos2))) { outputmode = -1; } } } else if (strcmp(name, "if-project-file-exists") == 0) { if (strstr(pos2, "..") == NULL) { if (!fexist - (fconcat(catbuff, StringBuff(fspath), pos2))) { + (fconcat(catbuff, sizeof(catbuff), StringBuff(fspath), pos2))) { outputmode = -1; } } } else if (strcmp(name, "if-file-do-not-exists") == 0) { if (strstr(pos2, "..") == NULL) { - if (fexist(fconcat(catbuff, path, pos2))) { + if (fexist(fconcat(catbuff, sizeof(catbuff), path, pos2))) { outputmode = -1; } } @@ -1498,7 +1498,7 @@ static int htslang_load(char *limit_to, char *path) { /* Load master file (list of keys and internal keys) */ if (!limit_to) { char *mname = "lang.def"; - FILE *fp = fopen(fconcat(catbuff, path, mname), "rb"); + FILE *fp = fopen(fconcat(catbuff, sizeof(catbuff), path, mname), "rb"); if (fp) { char intkey[8192]; @@ -1579,7 +1579,7 @@ static int htslang_load(char *limit_to, char *path) { hashname = LANGINTKEY(name); } sprintf(lbasename, "lang/%s.txt", hashname); - fp = fopen(fconcat(catbuff, path, lbasename), "rb"); + fp = fopen(fconcat(catbuff, sizeof(catbuff), path, lbasename), "rb"); if (fp) { char extkey[8192]; char value[8192]; |