Skip to content

Commit

Permalink
Merge pull request #11847 from fjmolinas/pr_fix_issue_11626
Browse files Browse the repository at this point in the history
pkg/semtech_loramac: fix memcpy to uninitialized pointer
  • Loading branch information
fjmolinas committed Jul 16, 2019
2 parents f812884 + aff7ee3 commit 1720e2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/semtech-loramac/contrib/semtech_loramac_getset.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void semtech_loramac_set_appskey(semtech_loramac_t *mac, const uint8_t *skey)
mutex_lock(&mac->lock);
MibRequestConfirm_t mibReq;
mibReq.Type = MIB_APP_SKEY;
memcpy(mibReq.Param.AppSKey, skey, LORAMAC_APPSKEY_LEN);
mibReq.Param.AppSKey = (uint8_t *) skey;
LoRaMacMibSetRequestConfirm(&mibReq);
mutex_unlock(&mac->lock);
}
Expand All @@ -84,7 +84,7 @@ void semtech_loramac_set_nwkskey(semtech_loramac_t *mac, const uint8_t *skey)
mutex_lock(&mac->lock);
MibRequestConfirm_t mibReq;
mibReq.Type = MIB_NWK_SKEY;
memcpy(mibReq.Param.NwkSKey, skey, LORAMAC_NWKSKEY_LEN);
mibReq.Param.NwkSKey = (uint8_t *) skey;
LoRaMacMibSetRequestConfirm(&mibReq);
mutex_unlock(&mac->lock);
}
Expand Down

0 comments on commit 1720e2d

Please sign in to comment.