diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2018-05-30 20:38:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-30 20:38:22 +0200 |
| commit | 1b3c79bad58d0b85980d428b1d75f9651392a4d3 (patch) | |
| tree | 5fcf5068f230c10081286dc737097d609f7737ee | |
| parent | 559e8f1227975fd7a1141096a9624504c992a461 (diff) | |
| parent | fb92dea72cea64e32743dffdcc3a382e64153935 (diff) | |
| download | PROJ-1b3c79bad58d0b85980d428b1d75f9651392a4d3.tar.gz PROJ-1b3c79bad58d0b85980d428b1d75f9651392a4d3.zip | |
Merge pull request #1022 from schwehr/gie-operation-overflow
Ensure that operations are less than MAX_OPERATION long.
| -rw-r--r-- | src/gie.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -170,8 +170,10 @@ static const char *err_const_from_errno (int err); #define SKIP -1 +#define MAX_OPERATION 10000 + typedef struct { - char operation[10000]; + char operation[MAX_OPERATION+1]; PJ *P; PJ_COORD a, b, c, e; PJ_DIRECTION dir; @@ -557,7 +559,8 @@ either a conversion or a transformation) T.operation_lineno = F->lineno; - strcpy (&(T.operation[0]), F->args); + strncpy (&(T.operation[0]), F->args, MAX_OPERATION); + T.operation[MAX_OPERATION] = '\0'; if (T.verbosity > 1) { finish_previous_operation (F->args); |
