All of lore.kernel.org
 help / color / mirror / Atom feed
* libxc/load_aou9.c signness fix gcc4
@ 2005-06-24 20:16 Jerone Young
  2005-06-24 20:35 ` Tim Newsham
  2005-06-24 20:40 ` Flavio Leitner
  0 siblings, 2 replies; 3+ messages in thread
From: Jerone Young @ 2005-06-24 20:16 UTC (permalink / raw)
  To: xen-devel

another gcc sign fix.

Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
--- tools/libxc/xc_load_aout9.c.old     2005-06-24 14:50:16.000000000
-0500
+++ tools/libxc/xc_load_aout9.c 2005-06-24 15:02:08.000000000 -0500
@@ -19,7 +19,7 @@
 static int parseaout9image(char *, unsigned long, struct
domain_setup_info *);
 static int loadaout9image(char *, unsigned long, int, u32, unsigned
long *, struct domain_setup_info *);
 static void copyout(int, u32, unsigned long *, unsigned long, void *,
int);
-struct Exec *get_header(unsigned char *, unsigned long, struct Exec *);
+struct Exec *get_header(char *, unsigned long, struct Exec *);


 int
@@ -139,7 +139,7 @@ copyout(
  */
 struct Exec *
 get_header(
-    unsigned char *image,
+    char *image,
     unsigned long image_size,
     struct Exec *ehdr)
 {

-- 
Jerone Young
IBM Linux Technology Center
jyoung5@us.ibm.com
512-838-1157 (T/L: 678-1157)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libxc/load_aou9.c signness fix gcc4
  2005-06-24 20:16 libxc/load_aou9.c signness fix gcc4 Jerone Young
@ 2005-06-24 20:35 ` Tim Newsham
  2005-06-24 20:40 ` Flavio Leitner
  1 sibling, 0 replies; 3+ messages in thread
From: Tim Newsham @ 2005-06-24 20:35 UTC (permalink / raw)
  To: Jerone Young; +Cc: xen-devel

> another gcc sign fix.

This fix is bad.  The proper fix is to add a cast.
An unsigned buffer will result in incorrect extraction
of big-endian values.

> -struct Exec *get_header(unsigned char *, unsigned long, struct Exec *);
> +struct Exec *get_header(char *, unsigned long, struct Exec *);

> struct Exec *
> get_header(
> -    unsigned char *image,
> +    char *image,
>     unsigned long image_size,
>     struct Exec *ehdr)

> Jerone Young
> jyoung5@us.ibm.com

Tim Newsham
http://www.lava.net/~newsham/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libxc/load_aou9.c signness fix gcc4
  2005-06-24 20:16 libxc/load_aou9.c signness fix gcc4 Jerone Young
  2005-06-24 20:35 ` Tim Newsham
@ 2005-06-24 20:40 ` Flavio Leitner
  1 sibling, 0 replies; 3+ messages in thread
From: Flavio Leitner @ 2005-06-24 20:40 UTC (permalink / raw)
  To: Jerone Young; +Cc: xen-devel



There are bit shifting operations inside of 
get_header() that, imho, will break if you
turn image signed. 


On Fri, Jun 24, 2005 at 03:16:28PM -0500, Jerone Young wrote:
> another gcc sign fix.
> 
> Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
> --- tools/libxc/xc_load_aout9.c.old     2005-06-24 14:50:16.000000000
> -0500
> +++ tools/libxc/xc_load_aout9.c 2005-06-24 15:02:08.000000000 -0500
> @@ -19,7 +19,7 @@
>  static int parseaout9image(char *, unsigned long, struct
> domain_setup_info *);
>  static int loadaout9image(char *, unsigned long, int, u32, unsigned
> long *, struct domain_setup_info *);
>  static void copyout(int, u32, unsigned long *, unsigned long, void *,
> int);
> -struct Exec *get_header(unsigned char *, unsigned long, struct Exec *);
> +struct Exec *get_header(char *, unsigned long, struct Exec *);
> 
> 
>  int
> @@ -139,7 +139,7 @@ copyout(
>   */
>  struct Exec *
>  get_header(
> -    unsigned char *image,
> +    char *image,
>      unsigned long image_size,
>      struct Exec *ehdr)
>  {
> 
> -- 
> Jerone Young
> IBM Linux Technology Center
> jyoung5@us.ibm.com
> 512-838-1157 (T/L: 678-1157)
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

-- 
Flávio Bruno Leitner <fbl@conectiva.com.br>
[0EA2 7F40 4CF4 1E63 4AF6  33C0 3E10 E205 F251 EDDA]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-06-24 20:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-24 20:16 libxc/load_aou9.c signness fix gcc4 Jerone Young
2005-06-24 20:35 ` Tim Newsham
2005-06-24 20:40 ` Flavio Leitner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.