Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 95671 Details for
Bug 145897
app-text/a2ps-4.13-r2 segfaults on amd64
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Replace incorrect use of memcpy with va_copy().
a2ps-4.13-vacopy.patch (text/plain), 1.14 KB, created by
Kevin F. Quinn (RETIRED)
on 2006-09-01 13:27:12 UTC
(
hide
)
Description:
Replace incorrect use of memcpy with va_copy().
Filename:
MIME Type:
Creator:
Kevin F. Quinn (RETIRED)
Created:
2006-09-01 13:27:12 UTC
Size:
1.14 KB
patch
obsolete
> It is not valid to copy va_list structures via memcpy; on some > architectures va_list is a 1-element array of a structure (see > stdarg(3) for details). The correct way to duplicate a va_list > is to use va_copy(). Note this is only available in C99. > Note; the contents of int_printflen can be moved to vprintflen > and int_printflen deleted. > > Kevin F. Quinn <kevquinn@gentoo.org> 2006-09-01 > >diff -ur a2ps-4.13.orig/lib/printlen.c a2ps-4.13/lib/printlen.c >--- a2ps-4.13.orig/lib/printlen.c 2006-09-01 22:08:14.000000000 +0200 >+++ a2ps-4.13/lib/printlen.c 2006-09-01 22:13:50.000000000 +0200 >@@ -28,14 +28,14 @@ > unsigned long strtoul (); > > static int >-int_printflen (const char *format, va_list *args) >+int_printflen (const char *format, va_list args) > { > const char *cp; > int total_width = 0; > int width = 0; > va_list ap; > >- memcpy (&ap, args, sizeof (va_list)); >+ va_copy(ap, args); > > for (cp = format ; *cp ; cp++) > { >@@ -93,13 +93,14 @@ > } > } > } >+ va_end(ap); > return total_width; > } > > int > vprintflen (const char *format, va_list args) > { >- return int_printflen (format, &args); >+ return int_printflen (format, args); > } > > int
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 145897
: 95671