diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-07-27 01:08:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-07-27 01:40:12 +0300 |
commit | 415860ebaeb990c0c8da27cc7aa565a137b97fe9 (patch) | |
tree | 379bc512894f445da63207d58c0956ea503a5f01 /src/map/itemdb.c | |
parent | 30ba171e28b10c5f9355cab5902fa311a234d833 (diff) | |
download | hercules-415860ebaeb990c0c8da27cc7aa565a137b97fe9.tar.gz hercules-415860ebaeb990c0c8da27cc7aa565a137b97fe9.tar.bz2 hercules-415860ebaeb990c0c8da27cc7aa565a137b97fe9.tar.xz hercules-415860ebaeb990c0c8da27cc7aa565a137b97fe9.zip |
Fix possible buffer overflows with snprintf.
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r-- | src/map/itemdb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 9a43bae14..2b0847e1a 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -1527,7 +1527,7 @@ void itemdb_read_combos(void) char filepath[256]; FILE* fp; - snprintf(filepath, 256, "%s/%s", map->db_path, DBPATH"item_combo_db.txt"); + safesnprintf(filepath, 256, "%s/%s", map->db_path, DBPATH"item_combo_db.txt"); if ((fp = fopen(filepath, "r")) == NULL) { ShowError("itemdb_read_combos: File not found \"%s\".\n", filepath); @@ -2231,7 +2231,7 @@ int itemdb_readdb_libconfig(const char *filename) { nullpo_ret(filename); - sprintf(filepath, "%s/%s", map->db_path, filename); + safesnprintf(filepath, sizeof(filepath), "%s/%s", map->db_path, filename); if (!libconfig->load_file(&item_db_conf, filepath)) return 0; |