MySQL: unterminated quoted connection values are accepted

Open Beginner friendly
#1,053 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c, mysql
Domain
databases

Research direction

Start in the key/value parsing path inside cwist_mysql_connect(): read how each field's value is scanned and where a quoted value is copied. The fix is to require the matching closing quote and a valid field delimiter before the copy, rejecting the rest. Add regression tests covering an unterminated quote, a quoted delimiter inside the value, and an empty quoted value; done means all three pass and existing connection-string tests still pass.

Written by the indexing model from the issue text.

Description

bug

The key/value parser added to cwist_mysql_connect() accepts a matching field even when its single- or double-quoted value has no closing quote. For example, password="secret is treated as valid instead of rejected. Require the closing quote and a valid field delimiter before copying the value, and add regression tests for unterminated quotes, quoted delimiters, and empty quoted values.

Dominant language
C
Stars
16
Forks
7
Avg merge
4h 17m
Merged PRs (30d)
198

Getting set up

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.

More from c4punks/CWIST

All issues in c4punks/CWIST

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.