pending/1212: [PATCH/RFA] Incorrect call to memset in ppc/sim/hw_nvram.c

Ian Lance Taylor ian@airs.com
Fri May 16 03:28:00 GMT 2003


>Number:         1212
>Category:       pending
>Synopsis:       [PATCH/RFA] Incorrect call to memset in ppc/sim/hw_nvram.c
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   unknown
>Arrival-Date:   Fri May 16 03:28:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 There is an apparently incorrect call to memset in ppc/sim/hw_nvram.c.
 The call is intended to zero out memory, but the zero was passed as
 the size argument, turning the call into a nop.
 
 I have no idea what problems this could cause, if any.
 
 Here is the patch.
 
 Ian
 
 
 2003-05-14  Ian Lance Taylor  <ian@airs.com>
 
 	* hw_nvram.c (hw_nvram_init_address): Correct call to memset--swap
 	second and third arguments.
 
 
 Index: hw_nvram.c
 ===================================================================
 RCS file: /cvs/src/src/sim/ppc/hw_nvram.c,v
 retrieving revision 1.1.1.1
 diff -u -r1.1.1.1 hw_nvram.c
 --- hw_nvram.c	16 Apr 1999 01:35:09 -0000	1.1.1.1
 +++ hw_nvram.c	14 May 2003 22:22:07 -0000
 @@ -140,7 +140,7 @@
      nvram->memory = zalloc(nvram->sizeof_memory);
    }
    else
 -    memset(nvram->memory, nvram->sizeof_memory, 0);
 +    memset(nvram->memory, 0, nvram->sizeof_memory);
    
    if (device_find_property(me, "timezone") == NULL)
      nvram->timezone = 0;
 
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gdb-prs mailing list