Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid crash with invalid integer flags #24

Closed
wants to merge 1 commit into from

Conversation

yoichi
Copy link
Contributor

@yoichi yoichi commented Oct 8, 2019

Since flag.IntVar accepts negative value, it may cause crash on subsequent processing.

e.g. on mlterm
negative-n-on-mlterm

@mattn
Copy link
Owner

mattn commented Oct 8, 2019

Thanks. But this is a bug of go-sixel. I'll open this as issue until fixing go-sixel.

@mattn
Copy link
Owner

mattn commented Oct 8, 2019

Fixed go-sixel.

@mattn mattn closed this Oct 8, 2019
@yoichi
Copy link
Contributor Author

yoichi commented Oct 8, 2019

I've observed crushed image and ''png: invalid format: invalid image size: 0x0" with iTerm2, Pixmap and ASCII. Those should be fixed in backends (iterm/iterm.go, pixterm/pixterm.go, ascii/ascii.go)?
crushed_cat

~/prog/longcat(master)$ ./longcat -ascii -n -3
       :d;';:cx,.
       do;';cl;lxk0'
.c:lc;.lc,;::ol   .
 ..'cxOd:;c:;c0;
     ..;c::;;;:.
       'x::cc::
       kkc;dkcl
      ,lcl;clco
~/prog/longcat(master)$ ./longcat -ascii -n -4
       ox  do
 . .  'ddxxoo:
~/prog/longcat(master)$ ./longcat -ascii -n -5
2019/10/09 06:15:05 png: invalid format: invalid image size: 0x0

@mattn
Copy link
Owner

mattn commented Oct 8, 2019

Yes, will fix in new issue.

@yoichi yoichi deleted the validate-integer-flags branch October 9, 2019 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants