X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=src%2Frfid_layer2_iso14443b.c;h=2523204c89946d341575cebf90f63d82c3cad2f9;hb=fae52b7006b68f0d1b171d8e2ed20a81dcff02ba;hp=d88fee5ae151a7731f8908d524de6eb35d6ec9d5;hpb=fb488a0210b1c694dba762ba086f43a5d4655c4f;p=librfid diff --git a/src/rfid_layer2_iso14443b.c b/src/rfid_layer2_iso14443b.c index d88fee5..2523204 100644 --- a/src/rfid_layer2_iso14443b.c +++ b/src/rfid_layer2_iso14443b.c @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include @@ -173,10 +173,8 @@ transceive_attrib(struct rfid_layer2_handle *h, const unsigned char *inf, int ret = 0; DEBUGP("fsd is %u\n", h->priv.iso14443b.fsd); - if (rx_len >= rx_len-1) { - perror("rx_len too large\n"); - goto out_attrib; - } + if (rx_len >= rx_len-1) + return -EINVAL; /* initialize attrib frame */ memset(&_attrib_buf, 0, sizeof(_attrib_buf)); @@ -230,7 +228,6 @@ transceive_attrib(struct rfid_layer2_handle *h, const unsigned char *inf, memcpy(rx_data, rx_buf+1, *rx_len); out_rx: - free(rx_buf); out_attrib: return ret; @@ -340,7 +337,7 @@ iso14443b_transceive(struct rfid_layer2_handle *handle, static int iso14443b_getopt(struct rfid_layer2_handle *handle, - int optname, void *optval, unsigned int optlen) + int optname, void *optval, unsigned int *optlen) { unsigned int *opt_ui = optval;