You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.4 KiB

  1. From 8a87a4ee9107f250254d5c93c6fd62224c400ce7 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  3. <ng.hong.quan@gmail.com>
  4. Date: Mon, 14 Jul 2014 01:30:28 +0800
  5. Subject: [PATCH 24/26] OpenPGP: Fix crash after accessing inexistent file.
  6. ---
  7. src/libopensc/card-openpgp.c | 3 ---
  8. 1 file changed, 3 deletions(-)
  9. Index: opensc-20150513/src/libopensc/card-openpgp.c
  10. ===================================================================
  11. --- opensc-20150513.orig/src/libopensc/card-openpgp.c
  12. +++ opensc-20150513/src/libopensc/card-openpgp.c
  13. @@ -981,7 +981,6 @@ pgp_select_file(sc_card_t *card, const s
  14. * So we set its size to be the same as max certificate size the card supports. */
  15. (*ret)->size = priv->max_cert_size;
  16. }
  17. - priv->current = NULL;
  18. LOG_FUNC_RETURN(card->ctx, SC_SUCCESS);
  19. }
  20. @@ -998,7 +997,6 @@ pgp_select_file(sc_card_t *card, const s
  21. /* This file ID is referred when importing key&certificate via pkcs15init, like above.
  22. * We pretend to successfully find this inexistent file. */
  23. if (id == 0x4402 || id == 0x5f48) {
  24. - priv->current = NULL;
  25. if (ret == NULL)
  26. /* No need to return file */
  27. LOG_FUNC_RETURN(card->ctx, SC_SUCCESS);
  28. @@ -1010,7 +1008,6 @@ pgp_select_file(sc_card_t *card, const s
  29. }
  30. if (r < 0) { /* failure */
  31. - priv->current = NULL;
  32. LOG_FUNC_RETURN(card->ctx, r);
  33. }
  34. }