Subject: | Module segfaults if u2fclib_verifyRegistration returns 0 to indicate an error occurred |
Module segfaults if u2fclib_verifyRegistration returns 0 to indicate an error occurred.
The xs code tries to do a strncpy on it assuming it never returns 0.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 __strncpy_avx2 () at ../sysdeps/x86_64/multiarch/strcpy-avx2.S:301
301 ../sysdeps/x86_64/multiarch/strcpy-avx2.S: No such file or directory.
(gdb) bt
#0 __strncpy_avx2 () at ../sysdeps/x86_64/multiarch/strcpy-avx2.S:301
#1 0x00007fa4545f36c8 in strncpy (__len=10000, __src=<optimised out>, __dest=0x7ffe850cfe80 "(\377\f\205\376\177") at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106
#2 XS_Crypt__U2F__Server_u2fclib_verifyRegistration (cv=<optimised out>) at U2F.xs:79
#3 0x00005623c2ebde78 in Perl_pp_entersub ()
#4 0x00005623c2eb5f63 in Perl_runops_standard ()
#5 0x00005623c2e42171 in perl_run ()
#6 0x00005623c2e1d4ef in main ()