History

avutil/avsscanf: fix possible overreads when dealing with %c or %s

Paul B Mahol committed 5 years ago

Commit 13df9bf1 parent b0298ad1 file · +1 −1Browse files

Unified · Split

libavutil/avsscanf.c+1−1
@@ -113,7 +113,7 @@ static int ffshgetc(FFFILE *f) · 112 unmodified lines
113113 }
114114
115115 #define shlim(f, lim) ffshlim((f), (lim))
116−#define shgetc(f) (((f)->rpos != (f)->shend) ? *(f)->rpos++ : ffshgetc(f))
116+#define shgetc(f) (((f)->rpos < (f)->shend) ? *(f)->rpos++ : ffshgetc(f))
117117 #define shunget(f) ((f)->shend ? (void)(f)->rpos-- : (void)0)
118118
119119 static const unsigned char table[] = { -1,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t