| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
These were only used to construct constant strings with additional
length fields. However, we can just use standard constant character
arrays instead and let the compiler calculate the string length.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
| |
strncmp() isn't intended to be a secure strcmp() replacement, it is
designed to be used if you want to compare the first n characters of two
strings. Since we always compare character pointers with string
literals, switch to using strcmp() everywhere.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
| |
The bzero() and bcopy() functions are deprecated and were removed from
the POSIX standard in IEEE Std. 1003.1-2008. Remove all usages of
bzero()/bcopy() and replace them by appropriate memset()/memmove()
calls.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The last argument to strncat() should not be the total buffer length; it
should be the space remaining:
The strncat() function shall append not more than n bytes (a null
byte and bytes that follow it are not appended) from the array
pointed to by s2 to the end of the string pointed to by s1. The
initial byte of s2 overwrites the null byte at the end of s1. A
terminating null byte is always appended to the result.
This patch fixes a couple of potential buffer overflow vulnerabilities.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
Skip the newline check if fgets() returns a NULL string. Fixes another
warning seen with "-Wunused-result".
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
| |
We currently use this in one place only but might reuse this a couple of
times later (when migrating to libical).
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Extract iCal and pcal import/export routines into separate files. This
reduces complexity of the super huge "io.c" source file and makes it
easier to follow changes that affect the iCal and pcal routines only
(commits affecting both formats are very uncommon).
Before:
$ wc -l src/io.c
2938 src/io.c
After:
$ wc -l src/{io,ical,pcal}.c
1445 src/io.c
1263 src/ical.c
317 src/pcal.c
3025 total
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|