akmrakib / erlang-mysql-driver

Automatically exported from code.google.com/p/erlang-mysql-driver
Other
0 stars 0 forks source link

mysql:encode/1 incorrectly quotes deep lists #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. io:format("~s~n", [mysql:encode(["unescaped quote: '; drop users; select
'"])]).

What is the expected output? What do you see instead?

I would expect either:
'unescaped quote: \'; drop users; select \''
or an error (since the function doesn't claim to support deep lists).
However, I get:
'unescaped quote: '; drop users; select ''

What version of the product are you using? On what operating system?

r33, Linux/i386, OpenSuse 11.1

Please provide any additional information below.

The attached patch makes the quote function fail noisily on invalid input
instead of silently accepting it.

Original issue reported on code.google.com by magnus.h...@gmail.com on 1 Oct 2009 at 6:11

Attachments: