apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 56520] New: Unchecked Return Value malloc() in win32 timestr on WINDOWS platform
Date Tue, 13 May 2014 17:18:05 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=56520

            Bug ID: 56520
           Summary: Unchecked Return Value malloc() in win32 timestr on
                    WINDOWS platform
           Product: APR
           Version: HEAD
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
          Assignee: bugs@apr.apache.org
          Reporter: max@cert.cx

Unchecked Return Value malloc() in win32 timestr on WINDOWS platform

static apr_size_t win32_strftime_extra(char *s, size_t max, const char *format,
                                       const struct tm *tm) 
{
   /* If the new format string is bigger than max, the result string won't fit
    * anyway. If format strings are added, made sure the padding below is
    * enough */
    char *new_format = (char *) malloc(max + 11); <============ MALLOC
    size_t i, j, format_length = strlen(format);
    apr_size_t return_value;
    int length_written;

    for (i = 0, j = 0; (i < format_length && j < max);) {
        if (format[i] != '%') {
            new_format[j++] = format[i++]; <============ INVALID MEMORY
REFERENCE
            continue;

BR,
Maksymilian
cifrex.org

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message