* Modified strcpy to strncpy to avoid buffer overflow in some cases.
@@ -1,6 +1,6 @@ | ||
1 | 1 | #! /bin/sh |
2 | 2 | # Guess values for system-dependent variables and create Makefiles. |
3 | -# Generated by GNU Autoconf 2.69 for gpx2shp 0.69. | |
3 | +# Generated by GNU Autoconf 2.69 for gpx2shp 0.70. | |
4 | 4 | # |
5 | 5 | # Report bugs to <hiraoka @at@ azukimap.jp>. |
6 | 6 | # |
@@ -580,8 +580,8 @@ | ||
580 | 580 | # Identity of this package. |
581 | 581 | PACKAGE_NAME='gpx2shp' |
582 | 582 | PACKAGE_TARNAME='gpx2shp' |
583 | -PACKAGE_VERSION='0.69' | |
584 | -PACKAGE_STRING='gpx2shp 0.69' | |
583 | +PACKAGE_VERSION='0.70' | |
584 | +PACKAGE_STRING='gpx2shp 0.70' | |
585 | 585 | PACKAGE_BUGREPORT='hiraoka @at@ azukimap.jp' |
586 | 586 | PACKAGE_URL='' |
587 | 587 |
@@ -1259,7 +1259,7 @@ | ||
1259 | 1259 | # Omit some internal or obsolete options to make the list less imposing. |
1260 | 1260 | # This message is too long to be a string in the A/UX 3.1 sh. |
1261 | 1261 | cat <<_ACEOF |
1262 | -\`configure' configures gpx2shp 0.69 to adapt to many kinds of systems. | |
1262 | +\`configure' configures gpx2shp 0.70 to adapt to many kinds of systems. | |
1263 | 1263 | |
1264 | 1264 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1265 | 1265 |
@@ -1325,7 +1325,7 @@ | ||
1325 | 1325 | |
1326 | 1326 | if test -n "$ac_init_help"; then |
1327 | 1327 | case $ac_init_help in |
1328 | - short | recursive ) echo "Configuration of gpx2shp 0.69:";; | |
1328 | + short | recursive ) echo "Configuration of gpx2shp 0.70:";; | |
1329 | 1329 | esac |
1330 | 1330 | cat <<\_ACEOF |
1331 | 1331 |
@@ -1413,7 +1413,7 @@ | ||
1413 | 1413 | test -n "$ac_init_help" && exit $ac_status |
1414 | 1414 | if $ac_init_version; then |
1415 | 1415 | cat <<\_ACEOF |
1416 | -gpx2shp configure 0.69 | |
1416 | +gpx2shp configure 0.70 | |
1417 | 1417 | generated by GNU Autoconf 2.69 |
1418 | 1418 | |
1419 | 1419 | Copyright (C) 2012 Free Software Foundation, Inc. |
@@ -1782,7 +1782,7 @@ | ||
1782 | 1782 | This file contains any messages produced by compilers while |
1783 | 1783 | running configure, to aid debugging if configure makes a mistake. |
1784 | 1784 | |
1785 | -It was created by gpx2shp $as_me 0.69, which was | |
1785 | +It was created by gpx2shp $as_me 0.70, which was | |
1786 | 1786 | generated by GNU Autoconf 2.69. Invocation command line was |
1787 | 1787 | |
1788 | 1788 | $ $0 $@ |
@@ -5237,7 +5237,7 @@ | ||
5237 | 5237 | # report actual input values of CONFIG_FILES etc. instead of their |
5238 | 5238 | # values after options handling. |
5239 | 5239 | ac_log=" |
5240 | -This file was extended by gpx2shp $as_me 0.69, which was | |
5240 | +This file was extended by gpx2shp $as_me 0.70, which was | |
5241 | 5241 | generated by GNU Autoconf 2.69. Invocation command line was |
5242 | 5242 | |
5243 | 5243 | CONFIG_FILES = $CONFIG_FILES |
@@ -5303,7 +5303,7 @@ | ||
5303 | 5303 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
5304 | 5304 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
5305 | 5305 | ac_cs_version="\\ |
5306 | -gpx2shp config.status 0.69 | |
5306 | +gpx2shp config.status 0.70 | |
5307 | 5307 | configured by $0, generated by GNU Autoconf 2.69, |
5308 | 5308 | with options \\"\$ac_cs_config\\" |
5309 | 5309 |
@@ -134,13 +134,13 @@ | ||
134 | 134 | * initialize a path attribute |
135 | 135 | */ |
136 | 136 | void initPathAttr(pathattr * pattr, g2sattr * attr) { |
137 | - strcpy(pattr->name, attr->name); | |
138 | - strcpy(pattr->cmt, attr->cmt); | |
139 | - strcpy(pattr->desc, attr->desc); | |
140 | - strcpy(pattr->src, attr->src); | |
141 | - strcpy(pattr->link, attr->link); | |
137 | + strncpy(pattr->name, attr->name, NAMELENGTH); | |
138 | + strncpy(pattr->cmt, attr->cmt, COMMENTLENGTH); | |
139 | + strncpy(pattr->desc, attr->desc, COMMENTLENGTH); | |
140 | + strncpy(pattr->src, attr->src, COMMENTLENGTH); | |
141 | + strncpy(pattr->link, attr->link, FILENAMELENGTH); | |
142 | 142 | pattr->number = attr->number; |
143 | - strcpy(pattr->type, attr->type); | |
143 | + strncpy(pattr->type, attr->type, TYPELENGTH); | |
144 | 144 | pattr->length = 0; |
145 | 145 | pattr->interval = 0; |
146 | 146 | pattr->speed = 0; |
@@ -309,12 +309,12 @@ | ||
309 | 309 | double leng = 0; |
310 | 310 | double spd; |
311 | 311 | if (pattr->count == 1) { |
312 | - strcpy(_t, attr->time); | |
312 | + strncpy(_t, attr->time, TIMELENGTH); | |
313 | 313 | } else { |
314 | 314 | /* time interval */ |
315 | 315 | intvl = getTimeInterval(_t, attr->time); |
316 | 316 | pattr->interval = pattr->interval + intvl; |
317 | - strcpy(_t, attr->time); | |
317 | + strncpy(_t, attr->time, TIMELENGTH); | |
318 | 318 | /* length interval */ |
319 | 319 | leng = getDistance(_x, _y, attr->lon, attr->lat); |
320 | 320 | pattr->length = pattr->length + leng; |
@@ -74,6 +74,9 @@ | ||
74 | 74 | /* Define to the one symbol short name of this package. */ |
75 | 75 | #undef PACKAGE_TARNAME |
76 | 76 | |
77 | +/* Define to the home page for this package. */ | |
78 | +#undef PACKAGE_URL | |
79 | + | |
77 | 80 | /* Define to the version of this package. */ |
78 | 81 | #undef PACKAGE_VERSION |
79 | 82 |
@@ -21,7 +21,7 @@ | ||
21 | 21 | * Shows a usage message |
22 | 22 | */ |
23 | 23 | void usage(char **argv) { |
24 | - fprintf(stdout, "Usage: %s gpxfile [options] [-o output basename]\n", | |
24 | + fprintf(stdout, "Usage: %s [options] [-o output basename] gpxfile\n", | |
25 | 25 | argv[0]); |
26 | 26 | fprintf(stdout, |
27 | 27 | "-o, --output Sets output basename. The default is (source file\n"); |
@@ -34,7 +34,7 @@ | ||
34 | 34 | pdata->attr->maxlat = atof(attr[i + 1]); |
35 | 35 | } |
36 | 36 | if (!strcmp(attr[i], "author")) { |
37 | - strcpy(pdata->attr->author, attr[i + 1]); | |
37 | + strncpy(pdata->attr->author, attr[i + 1], NAMELENGTH); | |
38 | 38 | } |
39 | 39 | } |
40 | 40 | if (pdata->prop->parseTrk) { |
@@ -82,26 +82,26 @@ | ||
82 | 82 | static int isFirstRteAsPoint = 1; |
83 | 83 | /* common elements */ |
84 | 84 | if (!strcmp(element, "name")) { |
85 | - strcpy(pdata->attr->name, pdata->databuf); | |
85 | + strncpy(pdata->attr->name, pdata->databuf, NAMELENGTH); | |
86 | 86 | } |
87 | 87 | if (!strcmp(element, "cmt")) { |
88 | - strcpy(pdata->attr->cmt, pdata->databuf); | |
88 | + strncpy(pdata->attr->cmt, pdata->databuf, COMMENTLENGTH); | |
89 | 89 | } |
90 | 90 | if (!strcmp(element, "desc")) { |
91 | - strcpy(pdata->attr->desc, pdata->databuf); | |
91 | + strncpy(pdata->attr->desc, pdata->databuf, COMMENTLENGTH); | |
92 | 92 | } |
93 | 93 | if (!strcmp(element, "src")) { |
94 | - strcpy(pdata->attr->src, pdata->databuf); | |
94 | + strncpy(pdata->attr->src, pdata->databuf, COMMENTLENGTH); | |
95 | 95 | } |
96 | 96 | if (!strcmp(element, "link")) { |
97 | - strcpy(pdata->attr->link, pdata->databuf); | |
97 | + strncpy(pdata->attr->link, pdata->databuf, FILENAMELENGTH); | |
98 | 98 | } |
99 | 99 | if (!strcmp(element, "type")) { |
100 | - strcpy(pdata->attr->type, pdata->databuf); | |
100 | + strncpy(pdata->attr->type, pdata->databuf, TYPELENGTH); | |
101 | 101 | } |
102 | 102 | /* waypoint and metadata elements */ |
103 | 103 | if (!strcmp(element, "time")) { |
104 | - strcpy(pdata->attr->time, pdata->databuf); | |
104 | + strncpy(pdata->attr->time, pdata->databuf, TIMELENGTH); | |
105 | 105 | } |
106 | 106 | /* route and track point elements */ |
107 | 107 | if (!strcmp(element, "number")) { |
@@ -118,10 +118,10 @@ | ||
118 | 118 | pdata->attr->geoidheight = atof(pdata->databuf); |
119 | 119 | } |
120 | 120 | if (!strcmp(element, "sym")) { |
121 | - strcpy(pdata->attr->sym, pdata->databuf); | |
121 | + strncpy(pdata->attr->sym, pdata->databuf, NAMELENGTH); | |
122 | 122 | } |
123 | 123 | if (!strcmp(element, "fix")) { |
124 | - strcpy(pdata->attr->fix, pdata->databuf); | |
124 | + strncpy(pdata->attr->fix, pdata->databuf, NAMELENGTH); | |
125 | 125 | } |
126 | 126 | if (!strcmp(element, "sat")) { |
127 | 127 | pdata->attr->sat = atoi(pdata->databuf); |
@@ -140,19 +140,19 @@ | ||
140 | 140 | } |
141 | 141 | /* metadata elements */ |
142 | 142 | if (!strcmp(element, "author")) { |
143 | - strcpy(pdata->attr->author, pdata->databuf); | |
143 | + strncpy(pdata->attr->author, pdata->databuf, NAMELENGTH); | |
144 | 144 | } |
145 | 145 | if (!strcmp(element, "keywords")) { |
146 | - strcpy(pdata->attr->keywords, pdata->databuf); | |
146 | + strncpy(pdata->attr->keywords, pdata->databuf, NAMELENGTH); | |
147 | 147 | } |
148 | 148 | if (!strcmp(element, "copyright")) { |
149 | - strcpy(pdata->attr->copyright, pdata->databuf); | |
149 | + strncpy(pdata->attr->copyright, pdata->databuf, NAMELENGTH); | |
150 | 150 | } |
151 | 151 | if (!strcmp(element, "year")) { |
152 | 152 | pdata->attr->year = atoi(pdata->databuf); |
153 | 153 | } |
154 | 154 | if (!strcmp(element, "license")) { |
155 | - strcpy(pdata->attr->license, pdata->databuf); | |
155 | + strncpy(pdata->attr->license, pdata->databuf, NAMELENGTH); | |
156 | 156 | } |
157 | 157 | if (!strcmp(element, "bounds")) { |
158 | 158 | /* none */ |