user440446
user440446

Reputation: 447

how to prevent SQL Injection in c language?

I currently use c language to process the http event, and I need to do the SQL operation with mysql, then how to prevent the SQL injection, is there any c library for that,thank you?

Upvotes: 4

Views: 3722

Answers (2)

R.. GitHub STOP HELPING ICE
R.. GitHub STOP HELPING ICE

Reputation: 215201

The way you prevent SQL injection (or shell escape injection, etc.) is not passing unquoted literal strings to an interface that treats some characters as special. You need to transform string data to a safe quoted form before including it as part of a larger "command string" that will be interpreted by an SQL database, shell, external command, API that takes URI strings, etc.

Upvotes: 2

Related Questions