Check arguments for the printf function if the width or positional argument will overflow.
https://github.com/vim/vim/pull/13799
(2 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
thanks. I'll move this to after the vim 9.1 release however
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
what is the magic 6400 here used? Can we make this a define and add a short description why it is 6400?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@cvwillegen pushed 3 commits.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
is this ready now?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
is this ready now?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@chrisbra commented on this pull request.
In src/strings.c:
> + const char **p,
+ unsigned int *uj)
+{
+ *uj = **p - '0';
+ ++*p;
+
+ while (VIM_ISDIGIT((int)(**p)) && *uj < MAX_ALLOWED_STRING_WIDTH)
+ {
+ *uj = 10 * *uj + (unsigned int)(**p - '0');
+ ++*p;
+ }
+
+ if (*uj > MAX_ALLOWED_STRING_WIDTH)
+ {
+ format_overflow_error(pstart);
+ return -1;
return FAIL
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
> + *uj = **p - '0';
+ ++*p;
+
+ while (VIM_ISDIGIT((int)(**p)) && *uj < MAX_ALLOWED_STRING_WIDTH)
+ {
+ *uj = 10 * *uj + (unsigned int)(**p - '0');
+ ++*p;
+ }
+
+ if (*uj > MAX_ALLOWED_STRING_WIDTH)
+ {
+ format_overflow_error(pstart);
+ return -1;
+ }
+
+ return 0;
return OK;
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
> @@ -2531,10 +2581,11 @@ parse_fmt_types( } // Positional argument - unsigned int uj = *p++ - '0'; + unsigned int uj; + + if (get_unsigned_int(pstart, &p, &uj) == -1)
== FAIL
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
> - while (VIM_ISDIGIT((int)(*p))) - uj = 10 * uj + (unsigned int)(*p++ - '0'); + if (get_unsigned_int(arg + 1, &p, &uj) == -1)
== FAIL
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
> - while (VIM_ISDIGIT((int)(*p))) - uj = 10 * uj + (unsigned int)(*p++ - '0'); + if (get_unsigned_int(digstart, &p, &uj) == -1)
same here
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
> - while (VIM_ISDIGIT((int)(*p))) - uj = 10 * uj + (unsigned int)(*p++ - '0'); + if (get_unsigned_int(arg + 1, &p, &uj) == -1)
and here
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
a left a few comments, please change the return value from 0/-1 to OK/FAIL instead.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
@cvwillegen pushed 1 commit.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
thanks. Let me include it.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()