[Git][NTPsec/ntpsec][master] Eliminate VLA - Variable Length Arrays

Hal Murray gitlab at mg.gitlab.com
Mon Oct 29 19:42:36 UTC 2018


Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
81855979 by Hal Murray at 2018-10-29T19:41:37Z
Eliminate VLA - Variable Length Arrays

- - - - -


1 changed file:

- tests/libntp/macencrypt.c


Changes:

=====================================
tests/libntp/macencrypt.c
=====================================
@@ -24,7 +24,10 @@ const char *packet = "ijklmnopqrstuvwx";
 const int packetLength = 16;
 const int keyIdLength = 4;
 const int digestLength = 16;
-const int totalLength = 36; //error: initializer element is not constant packetLength + keyIdLength + digestLength;
+
+/* Need #define to avoie VLA (variable length array) */
+#define totalLength 36
+
 char expectedMD5Packet[] = "ijklmnopqrstuvwx\0\0\0\0\x0c\x0e\x84\xcf\x0b\xb7\xa8\x68\x8e\x52\x38\xdb\xbc\x1c\x39\x53";
 char expectedCMACPacket[] = "ijklmnopqrstuvwx\0\0\0\0\xb0\xa1\xcf\xd2\x7f\x69\x0c\x43\xa7\x5d\x6c\x55\x91\x4b\x15\x14";
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/818559796fdf9776b698e6e7a20d6f25679a1787

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/818559796fdf9776b698e6e7a20d6f25679a1787
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20181029/17627822/attachment.html>


More information about the vc mailing list