aboutsummaryrefslogtreecommitdiff
path: root/ports/libu2f-server/strndup-fix.patch
blob: f5b7ffd8a7e5106d9efbee6f643aed0b54b40f4d (plain)
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
diff --git a/u2f-server/core.c b/u2f-server/core.c
index 294c94b..746932b 100644
--- a/u2f-server/core.c
+++ b/u2f-server/core.c
@@ -211,7 +211,7 @@ u2fs_rc u2fs_set_keyHandle(u2fs_ctx_t * ctx, const char *keyHandle)
     ctx->keyHandle = NULL;
   }
 
-  ctx->keyHandle = strndup(keyHandle, strlen(keyHandle));
+  ctx->keyHandle = strdup(keyHandle);
 
   if (ctx->keyHandle == NULL)
     return U2FS_MEMORY_ERROR;
@@ -726,7 +726,7 @@ static u2fs_rc decode_clientData(const char *clientData, char **output)
     fprintf(stderr, "clientData: %s\n", data);
   }
 
-  *output = strndup(data, strlen(data));
+  *output = strdup(data);
 
   free(data);
   data = NULL;
@@ -870,7 +870,7 @@ u2fs_rc u2fs_registration_verify(u2fs_ctx_t * ctx, const char *response,
     goto failure;
 
   u2fs_EC_KEY_t *key_ptr;
-  (*output)->keyHandle = strndup(buf, strlen(buf));
+  (*output)->keyHandle = strdup(buf);
 
   rc = decode_user_key(user_public_key, &key_ptr);
   if (rc != U2FS_OK)