[PATCH 3/3] Fix discards 'const' qualifier from pointer target type warnings

Steve Grubb sgrubb at redhat.com
Sat Feb 9 17:22:05 UTC 2013


On Friday, February 08, 2013 07:12:35 PM Tyler Hicks wrote:
> The event_note_list pointer is reassigned and its members are also
> reassigned. It should not be declared with the const qualifier.
> 
> The ptr variable, in unescape(), cannot be used to modify a string since
> it is initialized to the const char *buf input parameter. Rather than
> modifying buf, we can use ptr as a placeholder and use strndup() to
> allocate str. Later in the function a new, non-const pointer is used to
> modify str. These changes allow unescape() to still take a const char *
> as its input parameter.
> 
> Signed-off-by: Tyler Hicks <tyhicks at canonical.com>

Applied. Thanks for all 3 patches.

-Steve




More information about the Linux-audit mailing list