mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Check if width is zero or negative before fill; fix #3347
Reported by https://hackerone.com/haquaman.
This commit is contained in:
@@ -720,10 +720,10 @@ retry:
|
||||
CHECK(n);
|
||||
memcpy(buf+blen, c, n);
|
||||
blen += n;
|
||||
FILL(' ', width-1);
|
||||
if (width>0) FILL(' ', width-1);
|
||||
}
|
||||
else {
|
||||
FILL(' ', width-1);
|
||||
if (width>0) FILL(' ', width-1);
|
||||
CHECK(n);
|
||||
memcpy(buf+blen, c, n);
|
||||
blen += n;
|
||||
|
||||
Reference in New Issue
Block a user