21

So, i recently joined the community and must say im suprised by the lack of toxicity so probs to you people.

Anyway. I am almost finished with my internship as a Software enginieer(kind of). As my finshing presentation i made a script (mainly in Python with asciimatics(a great library btw)) wich is displayed in the Terminal (Linux Ubuntu) and as i know the kinds of people at my school i tryed to find any way they could crash it. (Already rebound the close window function from Alt + F4 to Alt+.)

Now im wondering if you; the nice people of Dev rant could suggest ways to make it safer or rather name ways you would attempt to shut it down. (i cant disable Keyboard input since that is needed to continue in the script.)

I wish you a nice day. and thanks in advance

Yours Humbly an aspiring Dev.

P.s.( i just really like to write formally. i think it sounds kind of cool.so dont you think im oldfashioned :D)

Comments
  • 2
    Welcome to dR
  • 8
    Fuck you for not thinking it's toxic!

    On a more serious note. I don't know what the program does.

    But malicious User Input is the culprit in most security flaws. So I would maybe run all user input through filter functions to ensure that they don't type anything stupid that crashes your program.

    Cheers and welcome to devrant.
  • 3
    @BigBoo Fuck you too

    and thanks for the feedback. The program only responds to serten keystrokes such es Y and N as yes and no.

    Thanks for the warm welcome and cheers
  • 2
  • 3
    @CaptainJuers 😄

    Alright. And it doesn't crash if I would do like

    python -c 'print("A"*1024)' | ./your_program

    ?
  • 0
    @BigBoo I suppose it would in perspective to what i think it does. Tho there would be the need for someone to exit to the actual terminal and then know the command too. However do you happen to know a way to fix this?
  • 1
    @CaptainJuers By filtering all your user input. I should be able to do whatever stupid input I feel like.

    For example pushing in characters when it expects integers and vice versa. Check input length. Do as much checking as you can basically.
  • 0
    @BigBoo I shall do that thank you very much!
  • 1
    Less toxicity is probs because downvotes actually matter. Just a few of them and the algo will push the post down into oblivion. Welcome here.

    A little trick you can do is only checking the first char, that way y and yes will still work but you limit commands like mentioned
  • 1
    @CaptainJuers Welcome Friend!
  • 2
    Welcome to our small huddled corner of the internet! We come in peace as long as you bring us good puns and constant complaints about bad syntax :)
  • 1
    Welcome to the craziness man
  • 2
    Welcome! I was going to comment the exact same as @BigBoo, look at what he says ;)
Add Comment