krakjoe / ui

Cross platform UI development in PHP
Other
518 stars 39 forks source link

[bug] Trying to getText from Entry with invalid type causes segfault #46

Closed dmvdbrugge closed 1 year ago

dmvdbrugge commented 6 years ago

What you do: Create an Entry with invalid type, call its getText()

What do you expect: UI\Exception\InvalidArgumentException from constructor

What happens: Segmentation fault, as shown below

dmvdbrugge@macbook:~/dynamic-components (master) $ php -a
Interactive shell

php > $e = new UI\Controls\Entry();
php > var_dump($e->getText());
string(0) ""
php > $e = new UI\Controls\Entry(1);
php > var_dump($e->getText());
string(0) ""
php > $e = new UI\Controls\Entry(2);
php > var_dump($e->getText());
string(0) ""
php > $e = new UI\Controls\Entry(3);
php > var_dump($e->getText());
string(0) ""
php > $e = new UI\Controls\Entry(4);
php > var_dump($e->getText());
Segmentation fault: 11

dmvdbrugge@macbook:~/dynamic-components (master) $ php -a
Interactive shell

php > $e = new UI\Controls\Entry(0);
php > var_dump($e->getText());
Segmentation fault: 11
dmvdbrugge commented 6 years ago

The exact same scenario holds for MultilineEntry as well as for example Box

dmvdbrugge commented 1 year ago

Closing to clean up my stuff and this repo is dead anyway.