Skip to content

Commit

Permalink
Fix wrong SCS codes sent by PD implementation
Browse files Browse the repository at this point in the history
phy_decode_packet() was written to be reused between CP and PD so it was
doing a more relaxed check at two places that allowed this bug to escape
uint and integration testing.

Fixes: #7

Reported-By: GitHub-User: z8a
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed May 27, 2020
1 parent 5a510d6 commit 2f4f660
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/osdp_pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ int pd_build_reply(struct osdp_pd *p, struct osdp_data *reply, uint8_t * pkt)

if (smb && (smb[1] > SCS_14) && isset_flag(p, PD_FLAG_SC_ACTIVE)) {
smb[0] = 2;
smb[1] = (len > 1) ? SCS_17 : SCS_15;
smb[1] = (len > 1) ? SCS_18 : SCS_16;
}

if (len == 0) {
Expand Down

0 comments on commit 2f4f660

Please sign in to comment.