1. 03 Mar, 2013 2 commits
  2. 02 Mar, 2013 21 commits
    • Philippe Teuwen's avatar
      Replace usb_set_debug() in utils by new group in LIBNFC_LOG_LEVEL · b68a37b8
      Philippe Teuwen authored
      To use it: (NFC_LOG_PRIORITY_DEBUG * 2 ^ NFC_LOG_GROUP_LIBUSB)
      LIBUSB_LOG_LEVEL=12288
      b68a37b8
    • Philippe Teuwen's avatar
      nfc-mfclassic: add option to tolerate RW errors & other enhancements · b1448f67
      Philippe Teuwen authored
      Reconciliate read & write operations.
      Add option to tolerate or not RW failures.
      Print success/failure for each block as ACL is per block.
      b1448f67
    • Philippe Teuwen's avatar
      ddd7cabd
    • Philippe Teuwen's avatar
      Fix compilation warnings: values never read · 2334adc8
      Philippe Teuwen authored
      Fixes:
      pn53x.c:523:11: warning: Value stored to 'pbtRawData' is never read
                pbtRawData += szRawData - 8;
                ^             ~~~~~~~~~~~~~
      pn53x.c:544:7: warning: Value stored to 'pbtRawData' is never read
            pbtRawData += 2;
            ^             ~
      pn53x.c:532:7: warning: Value stored to 'pbtRawData' is never read
            pbtRawData += 8;
            ^             ~
      pn53x.c:3085:3: warning: Value stored to 'buflen' is never read
        buflen -= res;
        ^         ~~~
      pn53x.c:3080:3: warning: Value stored to 'buf' is never read
        buf += res;
        ^      ~~~
      target-subr.c:466:7: warning: Value stored to 'dst' is never read
            dst += sprintf(dst, "* Unknown card, sorry\n");
            ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      target-subr.c:480:3: warning: Value stored to 'dst' is never read
        dst += sprint_hex(dst, nfi.abtSysCode, 2);
        ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      target-subr.c:490:3: warning: Value stored to 'dst' is never read
        dst += sprint_hex(dst, nji.btId, 4);
        ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      target-subr.c:546:7: warning: Value stored to 'dst' is never read
            dst += sprintf(dst, "\n");
            ^      ~~~~~~~~~~~~~~~~~~
      target-subr.c:571:5: warning: Value stored to 'dst' is never read
          dst += sprint_hex(dst, nii.abtAtr, nii.szAtrLen);
          ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      target-subr.c:580:3: warning: Value stored to 'dst' is never read
        dst += sprint_hex(dst, nsi.abtUID, 8);
        ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      target-subr.c:593:3: warning: Value stored to 'dst' is never read
        dst += sprintf(dst, "           Fab Code: %02X\n", nci.btFabCode);
        ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      target-subr.c:608:5: warning: Value stored to 'dst' is never read
          dst += sprint_hex(dst, ndi.abtGB, ndi.szGB);
          ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      2334adc8
    • Philippe Teuwen's avatar
      acr122_usb: fix compiler warnings & check return value · 70b0dffc
      Philippe Teuwen authored
      acr122_usb.c:570:3: warning: Null pointer passed as an argument to a 'nonnull' parameter
        memcpy(DRIVER_DATA(pnd)->apdu_frame.apdu_payload, data, data_len);
        ^                                                 ~~~~
      acr122_usb.c:738:3: warning: Value stored to 'offset' is never read
        offset += len;
        ^         ~~~
      acr122_usb.c:753:3: warning: Value stored to 'res' is never read
        res = acr122_usb_bulk_write(DRIVER_DATA(pnd), (unsigned char *) & (DRIVER_DATA(pnd)->tama_frame), res, 1000);
        ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      70b0dffc
    • Ludovic Rousseau's avatar
      Remove dead code · bd8a9fe9
      Ludovic Rousseau authored
      The local variable bFailure is set before a return.
      
      nfc-mfclassic.c:319:11: warning: Value stored to 'bFailure' is never read
                bFailure = true;
                ^          ~~~~
      bd8a9fe9
    • Philippe Teuwen's avatar
      make style · f07d784b
      Philippe Teuwen authored
      f07d784b
    • Ludovic Rousseau's avatar
      closedir() only if opendir() succeeds · 99963158
      Ludovic Rousseau authored
      Fix compiler warning:
      conf.c:186:3: warning: Null pointer passed as an argument to a 'nonnull' parameter
        closedir(d);
        ^        ~
      99963158
    • Ludovic Rousseau's avatar
      Initialize variables · aee56b92
      Ludovic Rousseau authored
      Fix compiler warnings and potential bug
      
      pn53x.c:1526:19: warning: The right operand of '<' is a garbage value
          for (i = 0; i < sz; i++) {
                        ^ ~~
      pn53x.c:1621:19: warning: The right operand of '<' is a garbage value
          for (i = 0; i < sz; i++) {
                        ^ ~~
      aee56b92
    • Philippe Teuwen's avatar
      Debian: remove non-exported symbol · abf54c75
      Philippe Teuwen authored
      abf54c75
    • Philippe Teuwen's avatar
      usbbus: make usb_initialized static · ae571941
      Philippe Teuwen authored
      ae571941
    • Philippe Teuwen's avatar
      Fix zealous double free · 1f0b0e5b
      Philippe Teuwen authored
      1f0b0e5b
    • Ludovic Rousseau's avatar
      Fix compiler warning · e7290de8
      Ludovic Rousseau authored
      nfc.c:121: warning: function declaration isn't a prototype
      nfc.c: In function 'nfc_drivers_init':
      nfc.c:121: warning: old-style function definition
      e7290de8
    • Romuald Conty's avatar
    • Philippe Teuwen's avatar
      make style · b2b1d2a2
      Philippe Teuwen authored
      b2b1d2a2
    • Philippe Teuwen's avatar
    • Philippe Teuwen's avatar
      07082792
    • Philippe Teuwen's avatar
      Add new symbols from usbbus.c · 35b08dc5
      Philippe Teuwen authored
      35b08dc5
    • Philippe Teuwen's avatar
      Fix mem leak in config file parser (opendir) · d7e7abb0
      Philippe Teuwen authored
      This fixes the following leaks:
      
      ==30517== 32,808 bytes in 1 blocks are definitely lost in loss record 11 of 12
      ==30517==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
      ==30517==    by 0x50F4B2A: __alloc_dir (opendir.c:186)
      ==30517==    by 0x4E34998: conf_devices_load.constprop.1 (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
      ==30517==    by 0x4E36350: nfc_context_new (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
      ==30517==    by 0x4E34D98: nfc_init (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
      d7e7abb0
    • Philippe Teuwen's avatar
      Fix mem leak in config file parser · 3d9ebb50
      Philippe Teuwen authored
      This fixes the following leaks:
      
      ==18690== 256 bytes in 1 blocks are definitely lost in loss record 75 of 100
      ==18690==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
      ==18690==    by 0x511613F: regcomp (regcomp.c:487)
      ==18690==    by 0x4E34313: conf_parse_file (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
      ==18690==    by 0x4E349F5: conf_devices_load.constprop.1 (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
      ==18690==    by 0x4E362C0: nfc_context_new (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
      ==18690==    by 0x4E34D08: nfc_init (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
      ==18690==
      ==18690== 32,068 (224 direct, 31,844 indirect) bytes in 1 blocks are definitely lost in loss record 98 of 100
      ==18690==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
      ==18690==    by 0x4C28D6F: realloc (vg_replace_malloc.c:632)
      ==18690==    by 0x5115DF3: re_compile_internal (regcomp.c:760)
      ==18690==    by 0x51161AB: regcomp (regcomp.c:506)
      ==18690==    by 0x4E34313: conf_parse_file (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
      ==18690==    by 0x4E349F5: conf_devices_load.constprop.1 (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
      ==18690==    by 0x4E362C0: nfc_context_new (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
      ==18690==    by 0x4E34D08: nfc_init (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
      3d9ebb50
    • Philippe Teuwen's avatar
      Fix mem leak with libusb by introducing buses/usbbus.c · 9dcf7378
      Philippe Teuwen authored
      Now call only once usb_init(); usb_find_busses(); usb_find_devices()
      instead of multiple calls in several scan() then open()
      
      This fixes the following leaks:
      
      ==1159== 8 bytes in 1 blocks are definitely lost in loss record 9 of 102
      ==1159==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
      ==1159==    by 0x53D9931: usb_parse_configuration (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
      ==1159==    by 0x53DB8B1: usb_os_find_devices (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
      ==1159==    by 0x53D8FDC: usb_find_devices (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
      ==1159==    by 0x4E41D79: pn53x_usb_scan (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
      ==1159==
      ==1159== 8 bytes in 1 blocks are definitely lost in loss record 10 of 102
      ==1159==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
      ==1159==    by 0x53D9931: usb_parse_configuration (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
      ==1159==    by 0x53DB8B1: usb_os_find_devices (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
      ==1159==    by 0x53D8FDC: usb_find_devices (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
      ==1159==    by 0x4E42CC7: pn53x_usb_open (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
      ==1159==    by 0x4E351E6: nfc_open (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
      9dcf7378
  3. 01 Mar, 2013 5 commits
  4. 22 Feb, 2013 3 commits
  5. 21 Feb, 2013 6 commits
  6. 18 Feb, 2013 2 commits
  7. 16 Feb, 2013 1 commit