lkml.org 
[lkml]   [2011]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] nconfig: prevent segfault on empty menu
From
Hi,

On Sat, Jul 9, 2011 at 10:04 PM, Andrej Gelenberg
<andrej.gelenberg@udo.edu> wrote:
> Hello,
>
> i found and fixed an NULL-dereference bug in nconf tool.
>
> How to reproduce:
> 1. $ make nconfig
> 2. disable "Kernel hacking -> Debug Filesystem"
> 3. go to "General setup -> GCOV-based kernel profiling" and hit F2
> it should segfault
>
> Fix: i have added some checks for "struct menu*" to be NULL before it
> get dereferenced
>
I am not a huge fan of this. The frontend should be careful not to try
to request the visibility or the prompt of an invalid menu. Following
this point of view, I would rather see assertion added than a test for
NULL, and fix the frontend appropriately to catch those case. Said
otherwise, there is no reason to apply a fix on the backend for an
nconfig-only issue.

- Arnaud

> Regards,
> Andrej Gelenberg
>


\
 
 \ /
  Last update: 2011-07-10 08:05    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site