Skip to content

Commit

Permalink
[openwrt] fix stack overflow in ubus call joinernum method
Browse files Browse the repository at this point in the history
This commit also adds the expiration_time parameter information.

Signed-off-by: Yejiang Luo <luoyejiang@gl-inet.com>
  • Loading branch information
lancersky2017 committed Aug 28, 2024
1 parent a088d34 commit 7e5f0e1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/openwrt/ubus/otubus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1226,9 +1226,9 @@ int UbusServer::UbusGetInformation(struct ubus_context *aContext,
void *jsonTable = nullptr;
void *jsonArray = nullptr;
otJoinerInfo joinerInfo;
uint16_t iterator = 0;
int joinerNum = 0;
char eui64[EXTPANID] = "";
uint16_t iterator = 0;
int joinerNum = 0;
char eui64[XPANID_LENGTH] = "";

blob_buf_init(&mBuf, 0);

Expand All @@ -1240,6 +1240,7 @@ int UbusServer::UbusGetInformation(struct ubus_context *aContext,
jsonTable = blobmsg_open_table(&mBuf, nullptr);

blobmsg_add_string(&mBuf, "pskd", joinerInfo.mPskd.m8);
blobmsg_add_u64(&mBuf, "expiration_time", joinerInfo.mExpirationTime);

switch (joinerInfo.mType)
{
Expand Down

0 comments on commit 7e5f0e1

Please sign in to comment.