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

Properly truncate strings which are too long to avoid buffer overflow. #10

Merged
merged 1 commit into from
May 24, 2017

Conversation

kenwu90
Copy link

@kenwu90 kenwu90 commented May 24, 2017

in AddVertex:
strcpy(vertex[num_vertices].name, name); -> strncpy(vertex[num_vertices].name, name, length-1);

in AddVertex:
        strcpy(vertex[num_vertices].name, name); -> strncpy(vertex[num_vertices].name, name, length-1);
@tangjianpku tangjianpku merged commit 69e7aa5 into tangjianpku:master May 24, 2017
@960924
Copy link

960924 commented Oct 29, 2019

Still: “Segmentation fault ”, what should I do?

Rho: 0.000498 Progress: 99.010%
Total time: 6.388185
Segmentation fault (core dumped)

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.

3 participants