Skip to content

Commit 508b06c

Browse files
authored
Merge pull request #96 from IVOES/fix-bad-strncpy-size
Use size of destination as third argument of strncpy()
2 parents a0854bd + 3b8ad1f commit 508b06c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gear-lib/libthread/libthread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ int thread_set_name(struct thread *t, const char *name)
149149
printf("pthread_setname_np %s failed: %d\n", name, errno);
150150
return -1;
151151
}
152-
strncpy(t->name, name, strlen(name));
152+
strncpy(t->name, name, sizeof(t->name));
153153
return 0;
154154
#else
155155
return 0;

0 commit comments

Comments
 (0)