Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
c941b153
Verified
Commit
c941b153
authored
1 year ago
by
Xavier Robin
Browse files
Options
Downloads
Patches
Plain Diff
fix SQL injection
parent
f36779d1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/conop/src/compound_lib.cc
+4
-1
4 additions, 1 deletion
modules/conop/src/compound_lib.cc
with
4 additions
and
1 deletion
modules/conop/src/compound_lib.cc
+
4
−
1
View file @
c941b153
...
...
@@ -509,11 +509,14 @@ CompoundPtr CompoundLib::FindCompound(const String& id,
}
query
+=
" FROM chem_compounds"
" WHERE tlc=
'"
+
id
+
"'
AND dialect='"
+
String
(
1
,
char
(
dialect
))
+
"'"
;
" WHERE tlc=
?
AND dialect='"
+
String
(
1
,
char
(
dialect
))
+
"'"
;
sqlite3_stmt
*
stmt
;
int
retval
=
sqlite3_prepare_v2
(
db_
->
ptr
,
query
.
c_str
(),
static_cast
<
int
>
(
query
.
length
()),
&
stmt
,
NULL
);
sqlite3_bind_text
(
stmt
,
1
,
id
.
c_str
(),
strlen
(
id
.
c_str
()),
NULL
);
if
(
SQLITE_OK
==
retval
)
{
int
ret
=
sqlite3_step
(
stmt
);
if
(
SQLITE_DONE
==
ret
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment