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

Booking bugs recently reported #1756

Merged
merged 3 commits into from
May 23, 2018
Merged

Conversation

masatake
Copy link
Member

In addition, remove test cases already reviewed.

@masatake
Copy link
Member Author

masatake commented May 21, 2018

It seems that a broken tag entry in a tags file triggers a bug of readtags.c.
I have to open a new issue eventually. Here is a temporary memorandum.

tags file:

greet	input.java	/^		public void greet (String word) {$;"	m	line:9	method:input.hello.anonXXX

The last slash at the end of pattern doesn't exist.

How to run:

[yamato@master]~/var/ctags-github% ./readtags  -t tags  - greet
zsh: segmentation fault (core dumped)  ./readtags -t tags - greet

How to fix the bug:

diff --git a/read/readtags.c b/read/readtags.c
index 81ce43ce..8c43b0ea 100644
--- a/read/readtags.c
+++ b/read/readtags.c
@@ -455,6 +452,7 @@ static void parseTagLine (tagFile *file, tagEntry *const entry)
 				if (p == NULL)
 				{
 					/* invalid pattern */
+					return;
 				}
 				else
 					++p;
@@ -470,6 +468,7 @@ static void parseTagLine (tagFile *file, tagEntry *const entry)
 			else
 			{
 				/* invalid pattern */
+				return;
 			}
 			fieldsPresent = (strncmp (p, ";\"", 2) == 0);
 			*p = '\0';

More study is needed.

readtags of Exuberant-ctags reproduces this bug.

… anonymous class)

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
@masatake
Copy link
Member Author

The newly found bug is fixed in #1757.

@coveralls
Copy link

coveralls commented May 22, 2018

Coverage Status

Coverage increased (+0.04%) to 84.905% when pulling 44176ed on masatake:booking-bugs into bf8aa43 on universal-ctags:master.

masatake added 2 commits May 22, 2018 21:07
…nested triangle brackets in template)

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
See 9122e09.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
@masatake masatake merged commit 6f7654b into universal-ctags:master May 23, 2018
This was referenced May 23, 2018
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