timmerk / libfreefare

Automatically exported from code.google.com/p/libfreefare
Other
0 stars 0 forks source link

Segfault : with libnfc-1.7.0-rc7 on nfc_init(NULL); #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile libfreefare against libnfc-1.7.0-rc7
2. Run mifare-classic-read-ndef

What is the expected output? What do you see instead?
Expected output : Some data
What I see : Segfault

What version of the product are you using? On what operating system?
libfreefare-0.3.4 from distributed tarball
Debian 7.0

Please provide any additional information below.
Segfault is easy to track :
mifare-classic-read-ndef.c:108:     nfc_init(NULL);
In nfc.c:183 :

  void
  nfc_init(nfc_context **context)
  {
    *context = nfc_context_new();
    if (!*context) {
      perror("malloc");
      return;
    }
    if (!nfc_drivers)
      nfc_drivers_init();
  } 

Clearly here, sending NULL to nfc_init will result in trying to write a new 
context at adresse 0, in the first line.

I think previous libnfc versions were compatible with sending them NULL, albeit 
I didn't checked.

Original issue reported on code.google.com by mandark....@gmail.com on 30 Jun 2013 at 6:58

GoogleCodeExporter commented 9 years ago
Hi, please wait for a new release of libfreefare or use the latest commits of 
libnfc & libfreefare.
libfreefare-0.3.4 was created just before libnfc-1.7.0-rc6 so it should work 
with libnfc-1.7.0-rc6 or rc5.

Original comment by yob...@gmail.com on 1 Jul 2013 at 8:10

GoogleCodeExporter commented 9 years ago
Does not work with libnfc-1.7.0-rc6 :
nfc_init(nfc_context **context)
{
  *context = nfc_context_new();

  if (!nfc_drivers)
    nfc_drivers_init();
}

Original comment by mandark....@gmail.com on 2 Jul 2013 at 6:39

GoogleCodeExporter commented 9 years ago
Does not work with libnfc-1.7.0-rc5
nfc_init(nfc_context **context)
{
  *context = nfc_context_new();

  if (!nfc_drivers)
    nfc_drivers_init();
}

Original comment by mandark....@gmail.com on 2 Jul 2013 at 6:41

GoogleCodeExporter commented 9 years ago
Now you juste have to reponen the ticket as it's not invalid ... ^-^

Original comment by mandark....@gmail.com on 2 Jul 2013 at 6:42

GoogleCodeExporter commented 9 years ago
I've changed it from invalid to wont fix, is that better?
I cannot change past releases and the code is already fixed in the repo, so the 
only thing to do is to compile from repo or wait the next release...
Sorry :-)

Original comment by yob...@gmail.com on 2 Jul 2013 at 8:32

GoogleCodeExporter commented 9 years ago
When will the new version of libfreefare be released?

Original comment by johannes...@ff-bisamberg.at on 14 Nov 2013 at 2:26

GoogleCodeExporter commented 9 years ago
Done! libfreefare 0.4.0 for libnfc 1.7.0 is now released!

Original comment by romu...@libnfc.org on 4 Dec 2013 at 10:15