wbokslag has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-tetra/+/28596 )
Change subject: fixed out of bounds write to pdu_sync buffer ......................................................................
fixed out of bounds write to pdu_sync buffer
Change-Id: I414bf2d61dc1cb37d30dc84b401a75b918116bbb --- M src/conv_enc_test.c 1 file changed, 4 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/96/28596/1
diff --git a/src/conv_enc_test.c b/src/conv_enc_test.c index 303ef31..150a564 100644 --- a/src/conv_enc_test.c +++ b/src/conv_enc_test.c @@ -335,12 +335,12 @@ srand(time(NULL)); for (i = 0; i < 100; i++) { uint32_t r = rand(); - osmo_pbit2ubit(pdu_sync, (uint8_t *) &r, 32); - osmo_pbit2ubit(pdu_sync+32, (uint8_t *)&r, 60-32); + *((uint32_t *)pdu_sync) = r; + *((uint32_t *)(pdu_sync+4)) = r; //build_sb();
- osmo_pbit2ubit(pdu_schf, (uint8_t *) &r, 32); - osmo_pbit2ubit(pdu_schf+32, (uint8_t *)&r, 60-32); + *((uint32_t *)pdu_schf) = r; + *((uint32_t *)(pdu_schf+4)) = r; build_ndb_schf(); } #endif