linkedin / linkedin/qark

Error while scanning (parsing). Unterminated character/string literal at " ' "

Open
#345 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.4k
Forks
663
PR merge metrics
No merged PRs in 30d

Description

Running scans...
Traceback (most recent call last):
File "/usr/local/bin/qark", line 11, in
load_entry_point('qark==4.0.0', 'console_scripts', 'qark')()
File "/usr/lib/python3/dist-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/qark-4.0.0-py3.6.egg/qark/qark.py", line 94, in cli
scanner.run()
File "/usr/local/lib/python3.6/dist-packages/qark-4.0.0-py3.6.egg/qark/scanner/scanner.py", line 64, in run
self._run_checks(plugins)
File "/usr/local/lib/python3.6/dist-packages/qark-4.0.0-py3.6.egg/qark/scanner/scanner.py", line 78, in _run_checks
current_file_subject.notify(filepath)
File "/usr/local/lib/python3.6/dist-packages/qark-4.0.0-py3.6.egg/qark/scanner/scanner.py", line 125, in notify
observer.update(file_path, call_run=True)
File "/usr/local/lib/python3.6/dist-packages/qark-4.0.0-py3.6.egg/qark/scanner/plugin.py", line 239, in update
super(CoroutinePlugin, self).update(file_path)
File "/usr/local/lib/python3.6/dist-packages/qark-4.0.0-py3.6.egg/qark/scanner/plugin.py", line 185, in update
JavaASTPlugin.java_ast = javalang.parse.parse(self.file_contents)
File "/usr/local/lib/python3.6/dist-packages/javalang-0.12.0-py3.6.egg/javalang/parse.py", line 52, in parse
parser = Parser(tokens)
File "/usr/local/lib/python3.6/dist-packages/javalang-0.12.0-py3.6.egg/javalang/parser.py", line 95, in init
self.tokens = util.LookAheadListIterator(tokens)
File "/usr/local/lib/python3.6/dist-packages/javalang-0.12.0-py3.6.egg/javalang/util.py", line 92, in init
self.list = list(iterable)
File "/usr/local/lib/python3.6/dist-packages/javalang-0.12.0-py3.6.egg/javalang/tokenizer.py", line 531, in tokenize
self.read_string()
File "/usr/local/lib/python3.6/dist-packages/javalang-0.12.0-py3.6.egg/javalang/tokenizer.py", line 201, in read_string
self.error('Unterminated character/string literal')
File "/usr/local/lib/python3.6/dist-packages/javalang-0.12.0-py3.6.egg/javalang/tokenizer.py", line 572, in error
raise error
javalang.tokenizer.LexerError: Unterminated character/string literal at "'", line 724: java.lang.UnsupportedOperationException: Can't linearise an unstructured statement

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at qark/scanner/plugin.py, especially JavaASTPlugin.update, and trace the call into javalang.parse.parse and tokenizer.read_string shown in the traceback. Reproduce the scan with the Java source containing the reported line 724; done means the scanner no longer aborts with this lexer traceback and the input is handled or reported appropriately.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, python
Domain
mobile-dev, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.