diff options
Diffstat (limited to 'WWW/Library')
-rw-r--r-- | WWW/Library/Implementation/HTAnchor.c | 4 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTDOS.c | 16 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTFile.c | 7 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTNews.c | 6 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTParse.c | 5 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTStyle.h | 4 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTTP.c | 38 | ||||
-rw-r--r-- | WWW/Library/Implementation/SGML.c | 4 |
8 files changed, 67 insertions, 17 deletions
diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c index 11a02ef1..2fc514c7 100644 --- a/WWW/Library/Implementation/HTAnchor.c +++ b/WWW/Library/Implementation/HTAnchor.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTAnchor.c,v 1.69 2010/09/25 12:39:08 tom Exp $ + * $LynxId: HTAnchor.c,v 1.70 2011/06/06 08:25:33 tom Exp $ * * Hypertext "Anchor" Object HTAnchor.c * ========================== @@ -170,7 +170,7 @@ static BOOL HTSEquivalent(const char *s, return (NO); } } - return (HT_EQUIV(*s, *t)); + return (BOOL) (HT_EQUIV(*s, *t)); } else { return (BOOL) (s == t); /* Two NULLs are equivalent, aren't they ? */ } diff --git a/WWW/Library/Implementation/HTDOS.c b/WWW/Library/Implementation/HTDOS.c index 1221bb55..582a7626 100644 --- a/WWW/Library/Implementation/HTDOS.c +++ b/WWW/Library/Implementation/HTDOS.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTDOS.c,v 1.38 2010/09/25 00:42:02 tom Exp $ + * $LynxId: HTDOS.c,v 1.39 2011/06/04 18:45:09 tom Exp $ * DOS specific routines */ @@ -12,6 +12,7 @@ #ifdef _WINDOWS #include <LYGlobalDefs.h> +#include <HTAlert.h> #endif /* @@ -108,7 +109,16 @@ char *HTDOS_name(const char *wwwname) static char *result = NULL; int joe; +#if defined(SH_EX) /* 2000/03/07 (Tue) 18:32:42 */ + if (unsafe_filename(wwwname)) { + HTUserMsg2("unsafe filename : %s", wwwname); + copy_plus(&result, "BAD_LOCAL_FILE_NAME"); + } else { + copy_plus(&result, wwwname); + } +#else copy_plus(&result, wwwname); +#endif #ifdef __DJGPP__ if (result[0] == '/' && result[1] == 'd' @@ -127,6 +137,10 @@ char *HTDOS_name(const char *wwwname) if ((result[1] != '\\') && (result[0] == '\\')) { for (joe = 0; (result[joe] = result[joe + 1]) != 0; joe++) ; } + /* convert '|' after the drive letter to ':' */ + if (isalpha(UCH(result[0])) && result[1] == '|') { + result[1] = ':'; + } #ifdef _WINDOWS /* 1998/04/02 (Thu) 08:59:48 */ if (LYLastPathSep(result) != NULL && !LYIsDosDrive(result)) { diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c index 5d692616..69b537a5 100644 --- a/WWW/Library/Implementation/HTFile.c +++ b/WWW/Library/Implementation/HTFile.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTFile.c,v 1.127 2010/10/27 00:10:02 tom Exp $ + * $LynxId: HTFile.c,v 1.128 2011/06/06 09:27:35 tom Exp $ * * File Access HTFile.c * =========== @@ -2088,8 +2088,9 @@ static int print_local_dir(DIR *dp, char *localname, */ if (strcmp(DIRED_NAME(HTBTree_object(next_element)), "..")) { #ifdef DIRED_SUPPORT - test = (DIRED_BLOK(HTBTree_object(next_element)) - == 'D' ? 'D' : 'F'); + test = + (char) (DIRED_BLOK(HTBTree_object(next_element)) + == 'D' ? 'D' : 'F'); if (state != test) { #ifndef LONG_LIST if (dir_list_style == FILES_FIRST) { diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c index eda9bf58..8a24ffa7 100644 --- a/WWW/Library/Implementation/HTNews.c +++ b/WWW/Library/Implementation/HTNews.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTNews.c,v 1.67 2010/10/27 00:10:51 tom Exp $ + * $LynxId: HTNews.c,v 1.68 2011/06/06 08:26:22 tom Exp $ * * NEWS ACCESS HTNews.c * =========== @@ -2486,8 +2486,8 @@ static int HTLoadNews(const char *arg, } SnipIn(command, "GROUP %.*s", 9, groupName); } else { - size_t add_open = (strchr(p1, '<') == 0); - size_t add_close = (strchr(p1, '>') == 0); + size_t add_open = (size_t) (strchr(p1, '<') == 0); + size_t add_close = (size_t) (strchr(p1, '>') == 0); if (strlen(p1) + add_open + add_close >= 252) { FREE(ProxyHost); diff --git a/WWW/Library/Implementation/HTParse.c b/WWW/Library/Implementation/HTParse.c index f69beaee..2e74e7f7 100644 --- a/WWW/Library/Implementation/HTParse.c +++ b/WWW/Library/Implementation/HTParse.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTParse.c,v 1.68 2011/05/24 09:21:01 tom Exp $ + * $LynxId: HTParse.c,v 1.69 2011/06/06 10:46:18 tom Exp $ * * Parse HyperText Document Address HTParse.c * ================================ @@ -300,7 +300,8 @@ static void convert_to_idna(char *host) buffer, idna_strerror((Idna_rc) code))); } - FREE(output); + if (output) + (free) (output); } free(buffer); } diff --git a/WWW/Library/Implementation/HTStyle.h b/WWW/Library/Implementation/HTStyle.h index 2e64d727..0e51e39c 100644 --- a/WWW/Library/Implementation/HTStyle.h +++ b/WWW/Library/Implementation/HTStyle.h @@ -1,5 +1,5 @@ /* - * $LynxId: HTStyle.h,v 1.16 2009/11/27 13:07:57 tom Exp $ + * $LynxId: HTStyle.h,v 1.17 2011/06/06 09:12:01 tom Exp $ HTStyle: Style management for libwww STYLE DEFINITION FOR HYPERTEXT @@ -156,7 +156,7 @@ extern "C" { * ----------- */ typedef struct _HTStyleSheet { - char *name; + const char *name; HTStyle *styles; } HTStyleSheet; diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c index 7ca3c1b9..cd6788da 100644 --- a/WWW/Library/Implementation/HTTP.c +++ b/WWW/Library/Implementation/HTTP.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTTP.c,v 1.121 2010/11/07 21:20:58 tom Exp $ + * $LynxId: HTTP.c,v 1.122 2011/06/05 20:38:32 tom Exp $ * * HyperText Tranfer Protocol - Client implementation HTTP.c * ========================== @@ -127,6 +127,21 @@ SSL *HTGetSSLHandle(void) SSL_CTX_set_default_verify_paths(ssl_ctx); SSL_CTX_set_verify(ssl_ctx, SSL_VERIFY_PEER, HTSSLCallback); #endif /* SSLEAY_VERSION_NUMBER < 0x0800 */ +#if defined(USE_PROGRAM_DIR) & !defined(USE_GNUTLS_INCL) + { + X509_LOOKUP *lookup; + + lookup = X509_STORE_add_lookup(ssl_ctx->cert_store, + X509_LOOKUP_file()); + if (lookup != NULL) { + char *certfile = NULL; + + HTSprintf0(&certfile, "%s\\cert.pem", program_dir); + X509_LOOKUP_load_file(lookup, certfile, X509_FILETYPE_PEM); + FREE(certfile); + } + } +#endif #ifdef USE_GNUTLS_INCL if ((certfile = LYGetEnv("SSL_CERT_FILE")) != NULL) { CTRACE((tfp, @@ -139,6 +154,13 @@ SSL *HTGetSSLHandle(void) "HTGetSSLHandle: certfile is set to %s by config SSL_CERT_FILE\n", certfile)); } +#if defined(USE_PROGRAM_DIR) + else { + HTSprintf0(&(certfile), "%s\\cert.pem", program_dir); + CTRACE((tfp, + "HTGetSSLHandle: certfile is set to %s by installed directory\n", certfile)); + } +#endif } #endif atexit(free_ssl_ctx); @@ -157,11 +179,23 @@ void HTSSLInitPRNG(void) if (RAND_status() == 0) { char rand_file[256]; time_t t; - int pid; long l, seed; +#ifndef _WINDOWS + pid_t pid; + +#else + DWORD pid; +#endif + t = time(NULL); + +#ifndef _WINDOWS pid = getpid(); +#else + pid = GetCurrentThreadId(); +#endif + RAND_file_name(rand_file, 256L); CTRACE((tfp, "HTTP: Seeding PRNG\n")); if (rand_file != NULL) { diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c index bd675aeb..defaf8bd 100644 --- a/WWW/Library/Implementation/SGML.c +++ b/WWW/Library/Implementation/SGML.c @@ -1,5 +1,5 @@ /* - * $LynxId: SGML.c,v 1.142 2010/12/10 01:46:10 tom Exp $ + * $LynxId: SGML.c,v 1.143 2011/06/06 09:10:38 tom Exp $ * * General SGML Parser code SGML.c * ======================== @@ -4634,7 +4634,7 @@ unsigned char *SJIS_TO_JIS1(unsigned HI, unsigned LO, unsigned char *JCODE) { - HI = UCH(HI - UCH((HI <= 0x9F) ? 0x71 : 0xB1)); + HI = UCH(HI - (unsigned) UCH((HI <= 0x9F) ? 0x71 : 0xB1)); HI = UCH((HI << 1) + 1); if (0x7F < LO) LO--; |