diff options
author | shennetsind <ind@henn.et> | 2015-01-18 11:37:45 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2015-01-18 11:37:45 -0200 |
commit | d0725afa8363b5f7b0612e087b48013d39339039 (patch) | |
tree | 3f521b45f4b0f0d3e7dee31cacfdd78d7be867ab /src/tool/mapcache.c | |
parent | a3c4d675ba19df385be5d1e3966c61de7186da57 (diff) | |
download | hercules-d0725afa8363b5f7b0612e087b48013d39339039.tar.gz hercules-d0725afa8363b5f7b0612e087b48013d39339039.tar.bz2 hercules-d0725afa8363b5f7b0612e087b48013d39339039.tar.xz hercules-d0725afa8363b5f7b0612e087b48013d39339039.zip |
Fixing 38 issues
Addressing out of bounds read/write, pointless null checks on already deferenced variables, dead code.
Special Thanks to 4144 and Haruna!
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/tool/mapcache.c')
-rw-r--r-- | src/tool/mapcache.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tool/mapcache.c b/src/tool/mapcache.c index cfd05b0aa..2cc70ebf3 100644 --- a/src/tool/mapcache.c +++ b/src/tool/mapcache.c @@ -192,13 +192,13 @@ void process_args(int argc, char *argv[]) for(i = 0; i < argc; i++) { if(strcmp(argv[i], "-grf") == 0) { if(++i < argc) - strcpy(grf_list_file, argv[i]); + safestrncpy(grf_list_file, argv[i], sizeof(grf_list_file)); } else if(strcmp(argv[i], "-list") == 0) { if(++i < argc) - strcpy(map_list_file, argv[i]); + safestrncpy(map_list_file, argv[i], sizeof(map_list_file)); } else if(strcmp(argv[i], "-cache") == 0) { if(++i < argc) - strcpy(map_cache_file, argv[i]); + safestrncpy(map_cache_file, argv[i], sizeof(map_cache_file)); } else if(strcmp(argv[i], "-rebuild") == 0) rebuild = 1; } |