openbsd-ports/security/clamav/patches/patch-libclamav_str_c
mbalmer 0963e86f43 Update to version 0.86.1 and add patches to fix problems on macppc (comparisons
that are always true due to char not being signed on this platform).

This update fixes a possible crash, see
http://sourceforge.net/project/shownotes.php?release_id=337279
for details.
2005-06-29 10:12:09 +00:00

27 lines
688 B
Plaintext

$OpenBSD: patch-libclamav_str_c,v 1.1 2005/06/29 10:12:09 mbalmer Exp $
--- libclamav/str.c.orig Wed Jun 29 11:31:49 2005
+++ libclamav/str.c Wed Jun 29 11:32:23 2005
@@ -92,8 +92,8 @@ short int *cli_hex2si(const char *hex)
char *cli_hex2str(const char *hex)
{
- char *str, *ptr, val, c;
- int i, len;
+ char *str, *ptr, val;
+ int c, i, len;
len = strlen(hex);
@@ -111,9 +111,9 @@ char *cli_hex2str(const char *hex)
for(i = 0; i < len; i += 2) {
if((c = cli_hex2int(hex[i])) >= 0) {
- val = c;
+ val = (char)c;
if((c = cli_hex2int(hex[i+1])) >= 0) {
- val = (val << 4) + c;
+ val = (val << 4) + (char)c;
} else {
free(str);
return NULL;