[Toybox] shell bug for "if [[ $a -lt 100 && $b -gt 100 ]]"

Mingliang HU 胡明亮 mingliang.hu at nio.com
Sun Jul 2 07:42:16 PDT 2023


One bug was found for the below shell script case.
#!/bin/bash
a=10
b=20
if [[ $a -lt 100 && $b -gt 100 ]]
then
   echo "return true"
else
   echo "return false"


toybox$ ./install/bin/sh test.sh
Segmentation fault

The crash looks happen at "&&" in if [[ $a -lt 100 && $b -gt 100 ]]


Best regards,
Mingliang



More information about the Toybox mailing list