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

segfault if 'tags' file is wrong format #139

Open
andy5995 opened this issue Sep 10, 2018 · 0 comments
Open

segfault if 'tags' file is wrong format #139

andy5995 opened this issue Sep 10, 2018 · 0 comments

Comments

@andy5995
Copy link
Contributor

If the tags file is incorrectly formatted, bric will segfault when using the tagstack function.

To generate the correct tags file, the user must use Exuberant Ctags.

On Debian, the package exuberant-tags can be installed.

See this for more info.
https://stackoverflow.com/questions/2968542/the-ctags-command-doesnt-recurse-saying-it-is-not-a-regular-file

Some debugging will needed to be done to find out what's specifically causing the segfault, and some type of check to see if the file is a proper tags file.

andy5995 added a commit that referenced this issue Sep 12, 2018
* tagstack.c:fix curr warning

This fixes the warning

```
tagstack.c: In function ‘pop’:
tagstack.c:37:10: warning: ‘curr’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
curr->p = NULL;
```

https://travis-ci.com/shnupta/bric/jobs/143067788#L512

This gets rid of the warning. I changed 'curr' to 'node' since we're
dealing with a "Linked List" here.

I don't see that calloc or malloc is needed. I'm initializing `node'
with `foo` after foo is initialized. Before, the warning was happening
because of the node->p = NULL assignment; if the while loop never
executes, node is not initialized before that assignment.

* tags document:updated with accurate info

(related to #139)
andy5995 added a commit that referenced this issue Sep 13, 2018
* tagstack.c:fix curr warning

This fixes the warning

```
tagstack.c: In function ‘pop’:
tagstack.c:37:10: warning: ‘curr’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
curr->p = NULL;
```

https://travis-ci.com/shnupta/bric/jobs/143067788#L512

This gets rid of the warning. I changed 'curr' to 'node' since we're
dealing with a "Linked List" here.

I don't see that calloc or malloc is needed. I'm initializing `node'
with `foo` after foo is initialized. Before, the warning was happening
because of the node->p = NULL assignment; if the while loop never
executes, node is not initialized before that assignment.

* tags document:updated with accurate info

(related to #139)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant