Fossil SCM

Fix two potential SQL injection attacks.

drh 2011-03-30 20:58 UTC jan-clientcert
Commit 71384ce6688c9dbea3083527fcebb442f238f1fd
1 file changed +2 -2
+2 -2
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -523,11 +523,11 @@
523523
524524
db_open_config(0);
525525
db_swap_connections();
526526
if( db_exists(
527527
"SELECT 1 FROM certs"
528
- " WHERE name='%s'",
528
+ " WHERE name='%q'",
529529
zContainer)!=0 ){
530530
fossil_fatal("certificate group \"%s\" already exists", zContainer);
531531
}
532532
db_begin_transaction();
533533
if( zCKey ){
@@ -601,11 +601,11 @@
601601
602602
db_open_config(0);
603603
db_swap_connections();
604604
db_begin_transaction();
605605
606
- db_multi_exec("DELETE FROM global_config WHERE name='certgroup:%s'",
606
+ db_multi_exec("DELETE FROM global_config WHERE name='certgroup:%q'",
607607
zURL);
608608
if( db_changes() == 0 ){
609609
fossil_warning("No certificate group associated with URL \"%s\".",
610610
zURL);
611611
}else{
612612
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -523,11 +523,11 @@
523
524 db_open_config(0);
525 db_swap_connections();
526 if( db_exists(
527 "SELECT 1 FROM certs"
528 " WHERE name='%s'",
529 zContainer)!=0 ){
530 fossil_fatal("certificate group \"%s\" already exists", zContainer);
531 }
532 db_begin_transaction();
533 if( zCKey ){
@@ -601,11 +601,11 @@
601
602 db_open_config(0);
603 db_swap_connections();
604 db_begin_transaction();
605
606 db_multi_exec("DELETE FROM global_config WHERE name='certgroup:%s'",
607 zURL);
608 if( db_changes() == 0 ){
609 fossil_warning("No certificate group associated with URL \"%s\".",
610 zURL);
611 }else{
612
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -523,11 +523,11 @@
523
524 db_open_config(0);
525 db_swap_connections();
526 if( db_exists(
527 "SELECT 1 FROM certs"
528 " WHERE name='%q'",
529 zContainer)!=0 ){
530 fossil_fatal("certificate group \"%s\" already exists", zContainer);
531 }
532 db_begin_transaction();
533 if( zCKey ){
@@ -601,11 +601,11 @@
601
602 db_open_config(0);
603 db_swap_connections();
604 db_begin_transaction();
605
606 db_multi_exec("DELETE FROM global_config WHERE name='certgroup:%q'",
607 zURL);
608 if( db_changes() == 0 ){
609 fossil_warning("No certificate group associated with URL \"%s\".",
610 zURL);
611 }else{
612

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button