OpenSC fork, with some Italian healthcare smart card utils
Go to file
ludovic.rousseau f47416d60e Do not cast the return value of malloc(3) and calloc(3)
From http://en.wikipedia.org/wiki/Malloc#Casting_and_type_safety
" Casting and type safety

malloc returns a void pointer (void *), which indicates that it is a
pointer to a region of unknown data type. One may "cast" (see type
conversion) this pointer to a specific type, as in

int *ptr = (int*)malloc(10 * sizeof (int));

When using C, this is considered bad practice; it is redundant under the
C standard. Moreover, putting in a cast may mask failure to include the
header stdlib.h, in which the prototype for malloc is found. In the
absence of a prototype for malloc, the C compiler will assume that
malloc returns an int, and will issue a warning in a context such as the
above, provided the error is not masked by a cast. On certain
architectures and data models (such as LP64 on 64 bit systems, where
long and pointers are 64 bit and int is 32 bit), this error can actually
result in undefined behavior, as the implicitly declared malloc returns
a 32 bit value whereas the actually defined function returns a 64 bit
value. Depending on calling conventions and memory layout, this may
result in stack smashing.

The returned pointer need not be explicitly cast to a more specific
pointer type, since ANSI C defines an implicit conversion between the
void pointer type and other pointers to objects. An explicit cast of
malloc's return value is sometimes performed because malloc originally
returned a char *, but this cast is unnecessary in standard C
code.[4][5] Omitting the cast, however, creates an incompatibility with
C++, which does require it.

The lack of a specific pointer type returned from malloc is type-unsafe
behaviour: malloc allocates based on byte count but not on type. This
distinguishes it from the C++ new operator that returns a pointer whose
type relies on the operand. (see C Type Safety). "

See also
http://www.opensc-project.org/pipermail/opensc-devel/2010-August/014586.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4636 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-18 15:08:51 +00:00
doc man: use --auth-id instead of bogus --pin-id in pkcs15-tool man page. [Ludolf Holzheid] 2010-07-26 11:17:53 +00:00
etc Fix and change ignored readers feature introducsed in r4626 for Windows. strcasestr is GNU specific extension. 2010-08-16 08:59:14 +00:00
m4 Assuan is not used. 2010-06-30 17:27:04 +00:00
solaris Thomas Uhle: modify Makefile so configure finds the include files 2009-12-03 07:05:15 +00:00
src Do not cast the return value of malloc(3) and calloc(3) 2010-08-18 15:08:51 +00:00
win32 win32: merge the branches/vtarasov/opensc-sm.trunk 2010-05-01 12:15:36 +00:00
COPYING - changed license to LGPL 2001-11-06 18:34:19 +00:00
Makefile.am automake gets packge name and version from AC_INIT. 2010-02-16 07:10:45 +00:00
Makefile.mak Header file cleanup. 2010-03-04 08:14:36 +00:00
NEWS Start documenting changes and increse libary version (we are no longer 2010-03-16 13:51:39 +00:00
README change more opensc.org references to opensc-project.org till dns is back. 2006-01-22 21:15:07 +00:00
bootstrap Add --force to autoreconf 2008-04-18 20:37:55 +00:00
configure.ac strlcat(3) implementation 2010-08-18 13:42:26 +00:00
svnignore Prepare for libtool-2 2008-06-05 17:03:47 +00:00

README

OpenSC documentation is now maintained in our online wiki at
	http://www.opensc-project.org/opensc/
and a copy in html format is provided in the doc/ directory
with all releases or snapshots of OpenSC in tar.gz files.

Please take a look at the documentation before trying to
install OpenSC. Most important are the pages
	
	OverView
A short introduction what OpenSC is and how it fits into the big picture. 

	WhatsNew
What is new, what has changed since the last major release? 
Also see this section for a list of incompatibilities.

Short list: libopensc is now version 2.0.0, i.e. you need to
recompile applications using opensc. And all libraries and
the opensc-pkcs11.so module moved from lib/pkcs11/ or lib/opensc/
to simply lib/. That fixes a number of problems, but you might
need to change some configuration.

	OperatingSystems
What your operating system needs to have for OpenSC to work. 

	CompilingInstalling
How to compile and install OpenSC yourself. 

	QuickStart
installation and basic steps to initialize a blank smart card. 

	UsingOpensc
options when using OpenSC. 


Also check the specific pages of the smart cards or crypto tokens you want
to use. If you have any trouble the MailingLists page will tell you how
to contact us for help.

Regards, the OpenSC Team.