Commit graph

1908 commits

Author SHA1 Message Date
Ludovic Rousseau
107b4ece8b Fix use after free bug
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.)
2013-09-19 20:38:56 +02:00
Ludovic Rousseau
967f6e5623 Remove dead code
The switch case has a default rule and a return in every cases. So the
code after the switch will never be executed.

Problem reported by thei Coverity tool
CID 1090408 (#1 of 1): Structurally dead code (UNREACHABLE)unreachable:
This code cannot be reached: "if (pn53x_current_target_ne...".
2013-09-19 20:34:58 +02:00
Philippe Teuwen
3a8db49a83 Remove debian/ now that there is an official inclusion in Debian 2013-09-11 00:00:43 +02:00
Nobuhiro Iwamatsu
fdcb2c3290 Add support kFreeBSD
kFreeBSD use cuaX as uart device.
This supports the kFreeBSD in Debian, and fix failure to build.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org>
2013-09-10 21:12:59 +02:00
Philippe Teuwen
70f6c24ebb Debian: fix Vcs-Git URL 2013-09-10 20:51:51 +02:00
Philippe Teuwen
ad9694cf00 nfc-list: New option to choose which technologies to poll for
This is useful especially against chips emulating several types
at once (e.g. PN53x, PN544 etc)
2013-09-09 15:58:07 +02:00
Ludovic Rousseau
dcb7d137c1 Fix watch file
Using the example at https://wiki.debian.org/debian/watch
2013-09-07 13:22:28 +02:00
Philippe Teuwen
c227e375ae Debian: 1.7.0~rc7 -> 1.7.0 2013-09-03 21:40:19 +02:00
Romuald Conty
ec933731b7 Prepare 1.7.0 version 2013-09-03 16:42:46 +02:00
Peter Meerwald
40672ed62b pn532: fix typo in comment
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-09-03 16:31:25 +02:00
Peter Meerwald
733080ba0c uart: fix typo 'eaten'
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-09-03 16:31:04 +02:00
Peter Meerwald
34bf7b3089 nfs-list: drop outdated examples superseeded by connection string
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-09-03 16:30:43 +02:00
Peter Meerwald
0b9fe52b2b pn53x: fix logging, timeout value
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-09-03 16:30:01 +02:00
Marcello Morena
98c4eee28f Modified the preamble sent to PN532 via UART from 5 bytes to 16 bytes, to comply with PN532 manual that says to send a "large" preamble in order to wake up the PN532. This is done to solve wakeup timeout problems on some PN532 Breakout Boards. 2013-09-03 16:01:36 +02:00
Romuald Conty
bcd479a5d2 Update ChangeLog and NEWS 2013-09-03 15:57:12 +02:00
Ludovic Rousseau
565134d4c4 Add missing \n in a printf() 2013-08-31 17:59:24 +02:00
Philippe Teuwen
a2a335e3d4 make style 2013-08-31 17:35:41 +02:00
Adam Laurie
07c54cd91b allow setting of UID for special 'chinese' ultralight cards 2013-08-31 16:15:27 +01:00
Philippe Teuwen
f6fff26f0f Fix warning "empty.c:1:0: warning: ISO C forbids an empty translation unit [-pedantic]" 2013-08-29 22:37:23 +02:00
Philippe Teuwen
b52308d071 TypeB ProtocolInfo: limit mask for ISO14443-4 support flag 2013-08-29 22:23:01 +02:00
Nobuhiro Iwamatsu
f1b4c8e7c2 Add entry for 1.7.0~rc7-1
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org>
2013-08-29 19:11:52 +02:00
Nobuhiro Iwamatsu
6f90560fa9 Remove unnecessary changelog
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org>
2013-08-29 19:10:00 +02:00
Ludovic Rousseau
f889de514b Fix symbols file contains debian revision
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org>
2013-08-29 19:09:33 +02:00
Ludovic Rousseau
e24d730644 Use bzip2 instead of gzip compression algorithm
The libnfc-1.7.0-rc7.tar.bz2 file is 25% smaller than the equivalent
libnfc-1.7.0-rc7.tar.gz file.
2013-08-29 19:04:04 +02:00
Ludovic Rousseau
f8d2d178d5 Use automake option subdir-objects
Fix for:
examples/Makefile.am:79: warning: source file
'doc/quick_start_example1.c' is in a subdirectory,
examples/Makefile.am:79: but option 'subdir-objects' is disabled
2013-08-29 18:59:41 +02:00
Ludovic Rousseau
c89532fa19 libnfcbuses.la use at least an empty source file
Closes issue #254: acr122_pcsc compilation failed on Mac OSX 10.8.4
2013-08-29 18:55:55 +02:00
Philippe Teuwen
8fe13ece62 pn53x_initiator_transceive_bytes_timed(): use proper CRC_B if TypeB 2013-08-19 15:47:44 +02:00
Philippe Teuwen
c3a5fba028 Adding iso14443b_crc_append() 2013-08-19 14:55:27 +02:00
Philippe Teuwen
bb5b712a74 Adding link to AUTHORS in the copyright headers 2013-07-17 13:57:56 +02:00
Philippe Teuwen
18fe330413 Fix warning Function call argument is an uninitialized value
acr122_usb.c:237:3: warning: Function call argument is an uninitialized value
  LOG_HEX(NFC_LOG_GROUP_COM, "TX", abtTx, szTx);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libnfc/log.h:107:7: note: expanded from macro 'LOG_HEX'
      snprintf (__acBuf + __szBuf, sizeof(__acBuf) - __szBuf, "%02x ",((uint8_t *)(pbtData))[__szPos]); \
      ^                                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Maybe a side effect of the #pragma pack not properly understood by the static analyser
but anyway acr122_usb_frame_template is also used the same way to initialize the other frames
2013-07-03 01:02:18 +02:00
Philippe Teuwen
2db4a0e7e4 make style
new version of astyle, better separation of XOR
2013-07-03 00:16:15 +02:00
Philippe Teuwen
a5d40cefc8 Fix warning about garbage value
acr122s.c:196:23: warning: The left operand of '<<' is a garbage value
  size_t frame_size = FRAME_SIZE(frame);
                      ^          ~~~~~~
acr122s.c:76:24: note: expanded from macro 'FRAME_SIZE'
                       ^
acr122s.c:74:47: note: expanded from macro 'APDU_SIZE'
2013-07-03 00:10:24 +02:00
Philippe Teuwen
5cda3af5d4 Fix warnings Null pointer passed as an argument to a nonnull parameter
acr122s.c:331:3: warning: Null pointer passed as an argument to a 'nonnull' parameter
  memcpy(buf, data, data_size);
  ^           ~~~~

pn53x.c:3138:3: warning: Null pointer passed as an argument to a 'nonnull' parameter
  memcpy(CHIP_DATA(pnd)->current_target, pnt, sizeof(nfc_target));
  ^                                      ~~~
2013-07-02 23:47:45 +02:00
Philippe Teuwen
56e9f1978d Fix warning increasing required alignment
acr122_usb.c:513:20: warning: cast from 'uint8_t *' (aka 'unsigned char *') to 'uint32_t *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Wcast-align]
  uint32_t *pu32 = (uint32_t *)u8;
                   ^~~~~~~~~~~~~~
2013-07-02 23:11:38 +02:00
Philippe Teuwen
cc7c0c32f1 Fix warning about incompatible types
pn53x.c:85:57: warning: Result of 'malloc' is converted to a pointer of type 'nfc_modulation_type', which is incompatible with sizeof operand type 'nfc_modulation'
    CHIP_DATA(pnd)->supported_modulation_as_initiator = malloc(sizeof(nfc_modulation) * 9);
                                                        ^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
2013-07-02 22:44:55 +02:00
Mike Auty
ebe6335fc1 Rerun usb_find_busses() and usb_find_devices() without recalling usb_init()
Fixes issue #252
2013-06-22 20:03:45 +02:00
Philippe Teuwen
03e1f23a40 Make use of new PN53x_ACK_FRAME__LEN 2013-06-15 23:14:54 +02:00
Laurent Latil
005713921e Update PN532/I2C sample config file for rev2.0 boards. Add a note regarding the change of I2C bus routing on R-Pi board rev 2.0. 2013-06-15 22:53:45 +02:00
Laurent Latil
80a41010fb Fix various problems in I2C support of PN532: - Fix a memory leak in pn532_i2c_wait_rdyframe() - Remove unused parameters and local variables - Fix all other compilation warnings
Note: a new constant (PN53x_ACK_FRAME__LEN) has been defined in
pn53x-internal.h file to avoid hard coding the ACK frame length.
2013-06-15 22:53:35 +02:00
Philippe Teuwen
957bebfd48 make style 2013-06-15 22:51:53 +02:00
Philippe Teuwen
9de66d463b UART: add support for BeagleBone serial ports
Thanks to Johan Henselmans!
2013-06-15 22:01:28 +02:00
Philippe Teuwen
d99bcb79fa I2C: add i2c support to CMake 2013-06-15 00:41:20 +02:00
Philippe Teuwen
5cc3f3551a I2C: add i2c to cppcheck 2013-06-15 00:37:08 +02:00
Philippe Teuwen
35da0c0b8a Update ChangeLog & NEWS 2013-06-15 00:35:18 +02:00
Philippe Teuwen
4c707e04ad I2C: add conf example 2013-06-15 00:25:08 +02:00
Philippe Teuwen
77445f1672 I2C: remove unneeded I2C_DRIVERS_ENABLED 2013-06-15 00:20:04 +02:00
Philippe Teuwen
3cd26a18f1 I2C: add Laurent Latil as author 2013-06-15 00:04:06 +02:00
Philippe Teuwen
238be3f068 make style 2013-06-15 00:01:25 +02:00
Laurent Latil
1b11450312 Add I2C protocol support for PN532. 2013-06-14 23:59:46 +02:00
Philippe Teuwen
6038aca7d1 acr122_usb: remove ACR122<>TOUCHATAG model distinction 2013-06-14 23:58:55 +02:00