1. 27 Jan, 2014 1 commit
  2. 02 Dec, 2013 1 commit
  3. 11 Nov, 2013 2 commits
  4. 22 Sep, 2013 6 commits
    • Philippe Teuwen's avatar
      nfc-read-forum-tag3: avoid passing large struct as parameter · 117b58f5
      Philippe Teuwen authored
      Problem reported by Coverity:
      CID 1090334 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
        pass_by_value: Passing parameter nt of type nfc_target const (size 291 bytes) by value.
      117b58f5
    • Philippe Teuwen's avatar
      nfc-relay-picc: sleep() expects unsigned int · cedbefb8
      Philippe Teuwen authored
      This avoids Coverity being unhappy that only lower bound was defined, well I hope
      
      lower_bounds: Checking lower bounds of signed scalar "waiting_time" by "waiting_time > 0".
      CID 1090343 (#1 of 1): Untrusted value as argument (TAINTED_SCALAR)
        tainted_data: Passing tainted variable "waiting_time" to a tainted sink.
        sleep(waiting_time);
      cedbefb8
    • Philippe Teuwen's avatar
      nfc-mfclassic: verify return of nfc_initiator_select_passive_target() · 61884967
      Philippe Teuwen authored
      Problem reported by Coverity:
      CID 1090323 (#1 of 1): Unchecked return value (CHECKED_RETURN)
        unchecked_value: No check of the return value of "nfc_initiator_select_passive_target(pnd, nmMifare, nt.nti.nai.abtUid, nt.nti.nai.szUidLen, NULL)".
      61884967
    • Philippe Teuwen's avatar
      Verify return of nfc_device_set_property_bool() · a4f466df
      Philippe Teuwen authored
      Problem reported by Coverity:
      CID 1090325 (#1 of 1): Unchecked return value (CHECKED_RETURN)
        unchecked_value: No check of the return value of "nfc_device_set_property_bool(pnd, NP_AUTO_ISO14443_4, false)".
      a4f466df
    • Philippe Teuwen's avatar
      nfc-emulate-forum-tag4: fix TOCTOU · 679897d0
      Philippe Teuwen authored
      Hopefully fix TOCTOU by calling fopen() before stat()
      
      At least this should prevent Coverity to complain about it:
      CID 1090346 (#1 of 1): Time of check time of use (TOCTOU)
        fs_check_call: Calling function "stat(char const *, struct stat *)" to perform check on "filename".
        toctou: Calling function "fopen(char const * restrict, char const * restrict)" that uses "filename" after a check function. This can cause a time-of-check, time-of-use race condition.
      
      Note that it seems pretty hard to avoid completely:
      https://en.wikipedia.org/wiki/Time_of_check_to_time_of_use#Preventing_TOCTTOU
      679897d0
    • Philippe Teuwen's avatar
      nfc-read-forum-tag3: remove redundant error · feb5f37a
      Philippe Teuwen authored
      switch case was redundant as getopt was already telling the issue:
      
        nfc-read-forum-tag3: option requires an argument -- 'o'
        Option -o requires an argument.
      
      This fixes also a problem reported by Coverity about missing break:
      
      CID 1090330 (#1 of 1): Missing break in switch (MISSING_BREAK)
        unterminated_case: This case (value 63) is not terminated by a 'break' statement.
      feb5f37a
  5. 21 Sep, 2013 1 commit
    • Philippe Teuwen's avatar
      Verify return of nfc_device_set_property_bool() · d9b531f5
      Philippe Teuwen authored
      Problem reported by Coverity
      CID 1090319 (#1 of 1): Unchecked return value (CHECKED_RETURN)
        unchecked_value: No check of the return value of "nfc_device_set_property_bool(pnd, NP_EASY_FRAMING, nt.nti.nai.btSak & 0x20)".
      CID 1090320 (#1 of 1): Unchecked return value (CHECKED_RETURN)
        unchecked_value: No check of the return value of "nfc_device_set_property_bool(dev, NP_HANDLE_CRC, false)".
      CID 1090324 (#1 of 2): Unchecked return value (CHECKED_RETURN)
        unchecked_value: No check of the return value of "nfc_device_set_property_bool(pnd, NP_ACTIVATE_FIELD, true)".
      CID 1090325 (#1 of 1): Unchecked return value (CHECKED_RETURN)
        unchecked_value: No check of the return value of "nfc_device_set_property_bool(pnd, NP_AUTO_ISO14443_4, false)".
      d9b531f5
  6. 19 Sep, 2013 1 commit
    • Ludovic Rousseau's avatar
      Fix use after free bug · 107b4ece
      Ludovic Rousseau authored
      nfc_exit(context); was called 2 times
      
      CID 1090348 (#1 of 1): Use after free (USE_AFTER_FREE)53. deref_arg:
      Calling "nfc_exit(nfc_context *)" dereferences freed pointer "context".
      (The dereference is assumed on the basis of the 'nonnull' parameter
      attribute.)
      107b4ece
  7. 09 Sep, 2013 1 commit
  8. 03 Sep, 2013 1 commit
  9. 31 Aug, 2013 2 commits
  10. 17 Jul, 2013 1 commit
  11. 02 Jul, 2013 1 commit
  12. 13 Jun, 2013 1 commit
  13. 09 Apr, 2013 1 commit
  14. 05 Apr, 2013 1 commit
  15. 12 Mar, 2013 6 commits
  16. 10 Mar, 2013 1 commit
  17. 07 Mar, 2013 2 commits
    • Alex Lian's avatar
      Windows: Clean up all compiler warnings and link warnings · 7b917f9a
      Alex Lian authored
      - Fixed the suppression of the auto-fixup for linking against MS built libs
      - Fixed all the formatting warnings by shifting to inttypes.h specifiers
      - shifted to %lu for DWORD printf
      7b917f9a
    • Alex Lian's avatar
      Convert by value passing of nfc_target to pointer for str_nfc_target and... · c72846e3
      Alex Lian authored
      Convert by value passing of nfc_target to pointer for str_nfc_target and nfc_initiator_target_is_present
      
      This becomes more consistent with all other pass by pointer of most structures.
      Additionally, this should lessen stack memory usage, as building strings with str_nfc_target would push the target (283 bytes) plus then a copy of the info objects (up to 275) onto the stack as it dives into the sprintf functions.
      
      Lastly, this makes my attempt at a .NET wrapper easier, as I can make passing by pointer work, but passing by value seems to bomb on the interop right now.
      c72846e3
  18. 06 Mar, 2013 2 commits
  19. 05 Mar, 2013 7 commits
    • Philippe Teuwen's avatar
      Fix cppcheck warning "scanf without field width limits can crash with huge input data" · d577fda4
      Philippe Teuwen authored
      Fix following warnings:
      [examples/pn53x-tamashell.c:162]: (warning) scanf without field width limits can crash with huge input data
      [libnfc/drivers/acr122_pcsc.c:261]: (warning) scanf without field width limits can crash with huge input data
      [libnfc/drivers/acr122s.c:441]: (warning) scanf without field width limits can crash with huge input data
      [libnfc/drivers/arygon.c:210]: (warning) scanf without field width limits can crash with huge input data
      [libnfc/drivers/arygon.c:522]: (warning) scanf without field width limits can crash with huge input data
      [libnfc/drivers/pn532_uart.c:187]: (warning) scanf without field width limits can crash with huge input data
      [utils/nfc-relay-picc.c:176]: (warning) scanf without field width limits can crash with huge input data
      d577fda4
    • Philippe Teuwen's avatar
      Fix cppcheck style: scope of variable can be reduced · 47693921
      Philippe Teuwen authored
      Fix the following cppcheck warnings:
      [libnfc/drivers/pn532_uart.c:492]: (style) The scope of the variable 'res' can be reduced
      [libnfc/chips/pn53x.c:320]: (style) The scope of the variable 'res' can be reduced
      [libnfc/chips/pn53x.c:616]: (style) The scope of the variable 'res' can be reduced
      [libnfc/nfc.c:356]: (style) The scope of the variable '_device_found' can be reduced
      [utils/nfc-mfclassic.c:178]: (style) The scope of the variable 'key_index' can be reduced
      47693921
    • Philippe Teuwen's avatar
      nfc-read-forum-tag3 & nfc-relay-picc: remove unused variable · 3f5a3fd5
      Philippe Teuwen authored
      Fix cppcheck warnings
      [utils/nfc-read-forum-tag3.c:281]: (style) Variable 'len' is assigned a value that is never used
      [utils/nfc-relay-picc.c:392]: (style) Variable 'res' is assigned a value that is never used
      3f5a3fd5
    • Philippe Teuwen's avatar
    • Philippe Teuwen's avatar
      examples/utils: add nfc_exit() to signal traps · e55efd6d
      Philippe Teuwen authored
      and one missing nfc_abort_command()
      e55efd6d
    • Philippe Teuwen's avatar
    • Philippe Teuwen's avatar
      Error conditions in utils & examples: fix leaks, unify style (see details) · bece73fa
      Philippe Teuwen authored
      * in main():
      ** errx()/err()/return -> exit()
      ** return values -> EXIT_SUCCESS & EXIT_FAILURE
      
      * out of main:
      ** err()/errx()/exit() -> return
      ** change retval from size_t to int to allow returning errors
      ** don't use EXIT_SUCCESS / EXIT_FAILURE as retvals
      
      * add nfc_close() & nfc_exit() to exit() on errors
      * add missing fclose() on errors
      * add missing test if (pnd == NULL)
      * unify style if (pnd == / != NULL)
      * remove goto's
      * few related fixes
      * remove if(pnd!=NULL) test on nfc_close() calls
      bece73fa
  20. 04 Mar, 2013 1 commit