Am Dienstag, 2. Mai 2006 09:58 schrieb Ludovic Rousseau: > This will not correct the bug since nothing guarantee that the last > byte will be NUL. > I propose the attached patch.
the memory was calloc()ed, so it is 0 after allocation, and since we only write up to the second last byte, the last byte of the label is supposed to be 0. or did I miss something? sorry, might be confused. > Another solution is to use strlcpy instead of strncpy. strlcpy has > been defined by OpenBSD as a safe replacement of strncpy. You can get > it from [1]. I use it in pcsc-lite > Some systems already provide it (OpenBSD, Darwin) so you need to add a > check in configure.in hmm. I don't like importing too many functions or extending configure too much, but it might be worth a look. maybe file a whishlist bug report so we don't forget? this week is linuxtag so I will be busy. but if you want to add it, feel free to do so in trunk (opensc and maybe other projects can use it too). Regards, Andreas _______________________________________________ opensc-devel mailing list [email protected] http://www.opensc-project.org/mailman/listinfo/opensc-devel
