pud: use more secure strncpy
authorFerry Huberts <ferry.huberts@pelagic.nl>
Sun, 24 Nov 2019 09:56:22 +0000 (10:56 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Sun, 24 Nov 2019 10:18:27 +0000 (11:18 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/configuration.c

index 1531392..9c4297b 100644 (file)
@@ -823,7 +823,7 @@ int setTxNmeaMessagePrefix(const char *value, void *data __attribute__ ((unused)
                return true;
        }
 
-       strcpy((char *) &txNmeaMessagePrefix[0], value);
+       strncpy((char *) &txNmeaMessagePrefix[0], value, sizeof(txNmeaMessagePrefix));
        txNmeaMessagePrefixSet = true;
        return false;
 }