Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a potential buffer overflow error #36

Merged
merged 1 commit into from
Jun 4, 2022
Merged

Conversation

raymond-u
Copy link
Contributor

This should fix an edge case, where the program would throw out a buffer overflow exception (or not, instead would read random bytes until it is met with '\0') if the seq length is smaller than the kmer length.

(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x0000155554fae859 in __GI_abort () at abort.c:79
#2  0x000015555501926e in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x15555514308f "*** %s ***: terminated\n") at ../sysdeps/posix/libc_fatal.c:155
#3  0x00001555550bbaba in __GI___fortify_fail (msg=msg@entry=0x155555143025 "buffer overflow detected") at fortify_fail.c:26
#4  0x00001555550ba356 in __GI___chk_fail () at chk_fail.c:28
#5  0x000055555555a316 in memset (__len=1043, __ch=0, __dest=0x155554b6e640) at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:71
#6  ErrorCorrection (id=<optimized out>, seq=0x55567526a284 "AATGATACGGCGACCACCG", qual=0x55567526a684 'F' <repeats 19 times>, pairStrongTrustThreshold=pairStrongTrustThreshold@entry=1608, 
    kcode=..., kmers=...) at ErrorCorrection.cpp:929
#7  0x000055555555a9a0 in ErrorCorrection_Thread (arg=0x7fffffff5910) at ErrorCorrection.cpp:118
#8  0x00001555554ee609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#9  0x00001555550ab133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

@mourisl
Copy link
Owner

mourisl commented Jun 4, 2022

Thank you for fixing this issue.

@mourisl mourisl merged commit 3ca0113 into mourisl:master Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants