| Message ID | 87lhxc1ggp.fsf@solnet.ch |
|---|---|
| State | Accepted |
| Commit | 56fa447282c47bf23d05e18a42bbd0184dbd8302 |
| Headers | show |
diff --git a/src/xkbtext.c b/src/xkbtext.c index bf992e4..4905f8b 100644 --- a/src/xkbtext.c +++ b/src/xkbtext.c @@ -920,11 +920,11 @@ CopyGroupActionArgs(Display *dpy, XkbDescPtr xkb, XkbAction *action, act = &action->group; TryCopyStr(buf, "group=", sz); if (act->flags & XkbSA_GroupAbsolute) - snprintf(tbuf, sizeof(buf), "%d", XkbSAGroup(act) + 1); + snprintf(tbuf, sizeof(tbuf), "%d", XkbSAGroup(act) + 1); else if (XkbSAGroup(act) < 0) - snprintf(tbuf, sizeof(buf), "%d", XkbSAGroup(act)); + snprintf(tbuf, sizeof(tbuf), "%d", XkbSAGroup(act)); else - snprintf(tbuf, sizeof(buf), "+%d", XkbSAGroup(act)); + snprintf(tbuf, sizeof(tbuf), "+%d", XkbSAGroup(act)); TryCopyStr(buf, tbuf, sz); if (act->type == XkbSA_LockGroup) return True;
On 02/15/14 08:35 AM, Andreas Wettstein wrote: > A pointer rather than the buffer was given to sizeof. As the data to be > written is only one or two bytes, a pointer size is at least four bytes, and > the buffer has 32 bytes, this error did not have negative effects. > > Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> > --- > src/xkbtext.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/src/xkbtext.c b/src/xkbtext.c > index bf992e4..4905f8b 100644 > --- a/src/xkbtext.c > +++ b/src/xkbtext.c > @@ -920,11 +920,11 @@ CopyGroupActionArgs(Display *dpy, XkbDescPtr xkb, XkbAction *action, > act = &action->group; > TryCopyStr(buf, "group=", sz); > if (act->flags & XkbSA_GroupAbsolute) > - snprintf(tbuf, sizeof(buf), "%d", XkbSAGroup(act) + 1); > + snprintf(tbuf, sizeof(tbuf), "%d", XkbSAGroup(act) + 1); > else if (XkbSAGroup(act) < 0) > - snprintf(tbuf, sizeof(buf), "%d", XkbSAGroup(act)); > + snprintf(tbuf, sizeof(tbuf), "%d", XkbSAGroup(act)); > else > - snprintf(tbuf, sizeof(buf), "+%d", XkbSAGroup(act)); > + snprintf(tbuf, sizeof(tbuf), "+%d", XkbSAGroup(act)); > TryCopyStr(buf, tbuf, sz); > if (act->type == XkbSA_LockGroup) > return True; > Oops, sorry about that - clearly I did too much copy & pasting. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
On 02/15/14 10:02 AM, Alan Coopersmith wrote: > On 02/15/14 08:35 AM, Andreas Wettstein wrote: >> A pointer rather than the buffer was given to sizeof. As the data to be >> written is only one or two bytes, a pointer size is at least four bytes, and >> the buffer has 32 bytes, this error did not have negative effects. >> >> Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> >> --- >> src/xkbtext.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/src/xkbtext.c b/src/xkbtext.c >> index bf992e4..4905f8b 100644 >> --- a/src/xkbtext.c >> +++ b/src/xkbtext.c >> @@ -920,11 +920,11 @@ CopyGroupActionArgs(Display *dpy, XkbDescPtr xkb, >> XkbAction *action, >> act = &action->group; >> TryCopyStr(buf, "group=", sz); >> if (act->flags & XkbSA_GroupAbsolute) >> - snprintf(tbuf, sizeof(buf), "%d", XkbSAGroup(act) + 1); >> + snprintf(tbuf, sizeof(tbuf), "%d", XkbSAGroup(act) + 1); >> else if (XkbSAGroup(act) < 0) >> - snprintf(tbuf, sizeof(buf), "%d", XkbSAGroup(act)); >> + snprintf(tbuf, sizeof(tbuf), "%d", XkbSAGroup(act)); >> else >> - snprintf(tbuf, sizeof(buf), "+%d", XkbSAGroup(act)); >> + snprintf(tbuf, sizeof(tbuf), "+%d", XkbSAGroup(act)); >> TryCopyStr(buf, tbuf, sz); >> if (act->type == XkbSA_LockGroup) >> return True; >> > > Oops, sorry about that - clearly I did too much copy & pasting. > > Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> And I just discovered in patchwork that these three patches from you, which were all quickly reviewed, still hadn't been pushed to git - fixed now, sorry for the delay: To ssh://git.freedesktop.org/git/xorg/lib/libxkbfile de4f230..56fa447 master -> master
A pointer rather than the buffer was given to sizeof. As the data to be written is only one or two bytes, a pointer size is at least four bytes, and the buffer has 32 bytes, this error did not have negative effects. Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> --- src/xkbtext.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)