libswd_drv_openocd.c:57
if (bits<0 && bits>8) return LIBSWD_ERROR_PARAM;
this can never be true.
This code exists in a few places, the above is just one example.
Additionally, in the miso case, if this code was fixed to correctly check the range, we would easily hit a failure when reading ACKs (3 bits).