-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathopensc.patch
More file actions
36 lines (31 loc) · 959 Bytes
/
Copy pathopensc.patch
File metadata and controls
36 lines (31 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Written and placed in public domain by Jeffrey Walton.
# This patch fixes some issues with OpenSC.
--- src/libopensc/pkcs15-openpgp.c
+++ src/libopensc/pkcs15-openpgp.c
@@ -412,14 +412,14 @@
for (i = 1; i <= PGP_NUM_PRIVDO; i++) {
sc_pkcs15_data_info_t dat_info;
sc_pkcs15_object_t dat_obj;
- char name[8];
- char path[9];
+ char name[8+10+1];
+ char path[9+10+1];
u8 content[254];
memset(&dat_info, 0, sizeof(dat_info));
memset(&dat_obj, 0, sizeof(dat_obj));
- snprintf(name, 8, "PrivDO%d", i);
- snprintf(path, 9, "3F00010%d", i);
+ snprintf(name, sizeof(name), "PrivDO%d", i);
+ snprintf(path, sizeof(path), "3F00010%d", i);
/* Check if the DO can be read and is not empty. Otherwise we
* won't expose a PKCS#15 DATA object.
--- src/common/simclist.c
+++ src/common/simclist.c
@@ -71,8 +71,10 @@
/* disable asserts */
#ifndef SIMCLIST_DEBUG
+#ifndef NDEBUG
#define NDEBUG
#endif
+#endif
#include <assert.h>