xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [BUG]Buffer Overflow in string library
@ 2013-09-13 21:33 Steve Calandra
  2013-09-14 16:03 ` Matthew Daley
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Calandra @ 2013-09-13 21:33 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 651 bytes --]

There is a potential, though unlikely buffer overflow vulnerability in the
function strlcpy() in string.c

size_t strlcpy(char *dest, const char *src, size_t size)
{
    size_t ret = strlen(src);
    size_t destLen = strLen(dest);
    if (size) {
        size_t len = (ret >= size) ? size-1 : ret;
        memcpy(dest, src, len);
        dest[len] = '\0';
    }
    return ret;
}

In the event that size is greater than the length of src and dest, dest
will be overflowed.  This can be fixed with the following:

if (len >= strlen(dest))
     len = strlen(dest) -1;

I tried fixing it myself, but I was having problems pushing the change to
the repo.

[-- Attachment #1.2: Type: text/html, Size: 850 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-16  0:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAHzqaHLSq2xu0VeEOvE1+7JyPx7F8ZYt6qKY68RfH108dsWW3A@mail.gmail.com>
2013-09-16  0:05 ` [BUG]Buffer Overflow in string library Matthew Daley
2013-09-13 21:33 Steve Calandra
2013-09-14 16:03 ` Matthew Daley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).