diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-07-23 13:10:59 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-23 13:10:59 +0300 |
| commit | 3a3a57cb8cbe6de6bce4c03068faef7dd469a9dd (patch) | |
| tree | 7ed8dd5ced8c861d070389f16554ad39b6ee6258 /ospfclient/ospf_apiclient.c | |
| parent | f4837b4bf855ab3a62e1b0b1dbcadfbc2c6cedb1 (diff) | |
| parent | ff6db1027f8f36df657ff2e5ea167773752537ed (diff) | |
Merge pull request #11656 from donaldsharp/some_memory
Some memory
Diffstat (limited to 'ospfclient/ospf_apiclient.c')
| -rw-r--r-- | ospfclient/ospf_apiclient.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ospfclient/ospf_apiclient.c b/ospfclient/ospf_apiclient.c index e84c6f5b3c..41f0b25b91 100644 --- a/ospfclient/ospf_apiclient.c +++ b/ospfclient/ospf_apiclient.c @@ -447,6 +447,12 @@ int ospf_apiclient_lsa_originate(struct ospf_apiclient *oclient, return OSPF_API_ILLEGALLSATYPE; } + if ((size_t)opaquelen > sizeof(buf) - sizeof(struct lsa_header)) { + fprintf(stderr, "opaquelen(%d) is larger than buf size %zu\n", + opaquelen, sizeof(buf)); + return OSPF_API_NOMEMORY; + } + /* Make a new LSA from parameters */ lsah = (struct lsa_header *)buf; lsah->ls_age = 0; |
