celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Broekhuis (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CELIX-198) Logging can segfault for strings 512 characters or longer
Date Wed, 07 Jan 2015 14:45:34 GMT

     [ https://issues.apache.org/jira/browse/CELIX-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alexander Broekhuis resolved CELIX-198.
---------------------------------------
       Resolution: Fixed
    Fix Version/s: next-incubating
         Assignee: Alexander Broekhuis

I've pushed a simple fix that increases the length to 1024 and uses vsnprintf. This should
prevent segfaults. A more dynamic solution can be implemented later if needed.

Is this good enough for now?

--------------------
Author: abroekhuis
Date: Wed Jan  7 14:43:57 2015
New Revision: 1650071

URL: http://svn.apache.org/r1650071
Log:
CELIX-198: Updated log_helper to use vsnprintf to prevent buffer overflows.

> Logging can segfault for strings 512 characters or longer
> ---------------------------------------------------------
>
>                 Key: CELIX-198
>                 URL: https://issues.apache.org/jira/browse/CELIX-198
>             Project: Celix
>          Issue Type: Bug
>            Reporter: Daniel Parker
>            Assignee: Alexander Broekhuis
>             Fix For: next-incubating
>
>
> log_service/public/src/log_helper.c::logHelper_log() uses a buffer of 512 bytes and doesn't
check to make sure that the buffer is long enough to hold the input string.  The buffer should
be increased (or dynamic memory allocation used) and the sizes should be checked to prevent
overrun (perhaps by using vnsprintf() instead of vsprintf() ).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message