hitoshura25/cvefixes huggingface dataset:
CVE-2013-2220 (C, published 2013-07-31T13:20Z)
Description: value: Buffer overflow in the radius_get_vendor_attr function in the Radius extension before 1.2.7 for PHP allows remote attackers to cause a denial of service (crash) and possibly execute arbitrary code via a large Vendor Specific Attributes (VSA) length value.
Severity: HIGH (CVSS v3 base score: )
Weakness: CWE-119 \u2014 Improper Restriction of Operations within the Bounds of a Memory Buffer
The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.
Repository: https://github.com/LawnGnome/php-radius
Files changed:
radius.c
radlib.c
radlib_vs.h
Commit message: Fix a security issue in radius_get_vendor_attr().

The underlying rad_get_vendor_attr() function assumed that it would always be
given valid VSA data. Indeed, the buffer length wasn't even passed in; the
assumption was that the length field within the VSA structure would be valid.

This could result in denial of service by providing a length that would be
beyond the memory limit, or potential arbitrary memory access by providing a
length greater than the actual data given.

rad_get_vendor_attr() has been changed to require the raw data length be
provided, and this is then used to check that the VSA is valid.

Conflicts:
	radlib_vs.h


Vulnerable code:
	int res;
	const void *data;
	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &data, &len) == FAILURE) {
	res = rad_get_vendor_attr(&vendor, &data, (size_t *) &len);
	if (res == -1) {
		add_assoc_long(return_value, "attr", res);
		add_assoc_stringl(return_value, "data", (char *) data, len, 1);
rad_get_vendor_attr(u_int32_t *vendor, const void **data, size_t *len)
	attr = (struct vendor_attribute *)*data;
int	rad_get_vendor_attr(u_int32_t *, const void **, size_t *);

Fixed code:
	const void *data, *raw;
	unsigned char type;
	size_t data_len;
	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &raw, &len) == FAILURE) {
	if (rad_get_vendor_attr(&vendor, &type, &data, &data_len, raw, len) == -1) {
		add_assoc_long(return_value, "attr", type);
		add_assoc_stringl(return_value, "data", (char *) data, data_len, 1);
rad_get_vendor_attr(u_int32_t *vendor, unsigned char *type, const void **data, size_t *len, const void *raw, size_t raw_len)
	if (raw_len < sizeof(struct vendor_attribute)) {
		return -1;
	}

	attr = (struct vendor_attribute *) raw;
	*type = attr->attrib_type;
	if ((attr->attrib_len + 4) > raw_len) {
		return -1;
	}

int	rad_get_vendor_attr(u_int32_t *, unsigned char *, const void **, size_t *, const void *, size_t);
CVE-2024-37168 (Unknown, published 2024-06-10T22:15Z)
Description: value: @grpc/grps-js implements the core functionality of gRPC purely in JavaScript, without a C++ addon. Prior to versions 1.10.9, 1.9.15, and 1.8.22, there are two separate code paths in which memory can be allocated per message in excess of the `grpc.max_receive_message_length` channel option: If an incoming message has a size on the wire greater than the configured limit, the entire message is buffered before it is discarded; and/or if an incoming message has a size within the limit on the wire but decompresses to a size greater than the limit, the entire message is decompressed into memory, and on the server is not discarded. This has been patched in versions 1.10.9, 1.9.15, and 1.8.22.

Severity: nan (CVSS v3 base score: )
Weakness: NVD-CWE-noinfo \u2014 Insufficient Information
There is insufficient information about the issue to classify it; details are unkown or unspecified.
Repository: https://github.com/grpc/grpc-node
Files changed:
Commit message: Merge pull request from GHSA-7v5v-9h63-cj86

grpc-js: Avoid buffering significantly more than max_receive_message_size per received message

Vulnerable code:

Fixed code:
CVE-2021-42836 (Go, published 2021-10-22T18:15Z)
Description: value: GJSON before 1.9.3 allows a ReDoS (regular expression denial of service) attack.
Severity: MEDIUM (CVSS v3 base score: 7.5)
Weakness: CWE-400 \u2014 Uncontrolled Resource Consumption
The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
Repository: https://github.com/tidwall/gjson
Files changed:
gjson.go
gjson_test.go
go.mod
go.sum
Commit message: Limit the complexity of "like" queries that match on a pattern.

This commit adds the uses the MatchLimit function, which it the
same as Match but will limit the complexity of the input pattern.
This is to avoid long running matches, specifically to avoid ReDos
attacks from arbritary inputs.


Vulnerable code:
				pmatch = match.Match(unescape(key), rp.part)
				pmatch = match.Match(key, rp.part)
			return match.Match(value.Str, rpv)
			return !match.Match(value.Str, rpv)
	github.com/tidwall/match v1.1.0
github.com/tidwall/match v1.1.0 h1:VfI2e2aXLvytih7WUVyO9uvRC+RcXlaTrMbHuQWnFmk=
github.com/tidwall/match v1.1.0/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=

Fixed code:
				pmatch = matchLimit(unescape(key), rp.part)
				pmatch = matchLimit(key, rp.part)

// matchLimit will limit the complexity of the match operation to avoid ReDos
// attacks from arbritary inputs.
// See the github.com/tidwall/match.MatchLimit function for more information.
func matchLimit(str, pattern string) bool {
	matched, _ := match.MatchLimit(str, pattern, 10000)
	return matched
}

			return matchLimit(value.Str, rpv)
			return !matchLimit(value.Str, rpv)
	// Issue #237
	testJSON1 := `["*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,,,,,,"]`
	testJSON2 := `#[%"*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,,,,,,""*,*"]`
	Get(testJSON1, testJSON2)

	github.com/tidwall/match v1.1.1
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
CVE-2021-42836 (Other, published 2021-10-22T18:15Z)
Description: value: GJSON before 1.9.3 allows a ReDoS (regular expression denial of service) attack.
Severity: MEDIUM (CVSS v3 base score: 7.5)
Weakness: CWE-400 \u2014 Uncontrolled Resource Consumption
The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
Repository: https://github.com/tidwall/gjson
Files changed:
go.mod
go.sum
Commit message: Update match dependency

This commit updates the github.com/tidwall/match library, which
address an issue where it's possible to produce a ReDos attack.

fixes #236


Vulnerable code:
	github.com/tidwall/match v1.0.3
github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE=
github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=

Fixed code:
	github.com/tidwall/match v1.1.0
github.com/tidwall/match v1.1.0 h1:VfI2e2aXLvytih7WUVyO9uvRC+RcXlaTrMbHuQWnFmk=
github.com/tidwall/match v1.1.0/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
CVE-2020-13848 (Other, published 2020-06-04T20:15Z)
Description: value: Portable UPnP SDK (aka libupnp) 1.12.1 and earlier allows remote attackers to cause a denial of service (crash) via a crafted SSDP message due to a NULL pointer dereference in the functions FindServiceControlURLPath and FindServiceEventURLPath in genlib/service_table/service_table.c.
Severity: MEDIUM (CVSS v3 base score: 7.5)
Weakness: CWE-476 \u2014 NULL Pointer Dereference
The product dereferences a pointer that it expects to be valid but is NULL.
Repository: https://github.com/pupnp/pupnp
Files changed:
ChangeLog
upnp/src/genlib/service_table/service_table.c
Commit message: Fixes #177: NULL pointer dereference in FindServiceControlURLPath

Also fixes its dual bug in FindServiceEventURLPath.


Vulnerable code:
	if (table &&
		parse_uri(eventURLPath, strlen(eventURLPath), &parsed_url_in) ==
			HTTP_SUCCESS) {
	if (table && parse_uri(controlURLPath,
			     strlen(controlURLPath),
			     &parsed_url_in) == HTTP_SUCCESS) {

Fixed code:
2020-06-04 Patrik Lantz pjlantz(at)github

        Fixes #177

        NULL pointer dereference in FindServiceControlURLPath

	if (!table || !eventURLPath) {
		return NULL;
	}
	if (parse_uri(eventURLPath, strlen(eventURLPath), &parsed_url_in) ==
		HTTP_SUCCESS) {
	if (!table || !controlURLPath) {
		return NULL;
	}
	if (parse_uri(controlURLPath, strlen(controlURLPath), &parsed_url_in) ==
		HTTP_SUCCESS) {
CVE-2018-25079 (JavaScript, published 2023-02-04T04:15Z)
Description: value: A vulnerability was found in Segmentio is-url up to 1.2.2. It has been rated as problematic. Affected by this issue is some unknown functionality of the file index.js. The manipulation leads to inefficient regular expression complexity. The attack may be launched remotely. Upgrading to version 1.2.3 is able to address this issue. The patch is identified as 149550935c63a98c11f27f694a7c4a9479e53794. It is recommended to upgrade the affected component. VDB-220058 is the identifier assigned to this vulnerability.
Severity: nan (CVSS v3 base score: 7.5)
Weakness: CWE-1333 \u2014 Inefficient Regular Expression Complexity
The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles.
Repository: https://github.com/segmentio/is-url
Files changed:
index.js
test/index.js
Commit message: security: Fix REDOS vulnerability

Problem:
As disclosed by email, the regex in this module was vulnerable to
catastrophic backtracking.
This could be used as a REDOS vector for Node.js servers that use
this module.

Solution:
Use a two-step validation process.
Split the vulnerable regex into three safe ones.


Vulnerable code:
 * Matcher.
var matcher = /^(?:\w+:)?\/\/([^\s\.]+\.\S{2}|localhost[\:?\d]*)\S*$/;
  return matcher.test(string);

Fixed code:
 * RegExps.
 * A URL must match #1 and then at least one of #2/#3.
 * Use two levels of REs to avoid REDOS.
var protocolAndDomainRE = /^(?:\w+:)?\/\/(\S+)$/;

var localhostDomainRE = /^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/
var nonLocalhostDomainRE = /^[^\s\.]+\.\S{2,}$/;
  var match = string.match(protocolAndDomainRE);
  if (!match) {
    return false;
  }

  var everythingAfterProtocol = match[1];
  if (!everythingAfterProtocol) {
    return false;
  }

  if (localhostDomainRE.test(everythingAfterProtocol) ||
      nonLocalhostDomainRE.test(everythingAfterProtocol)) {
    return true;
  }

  return false;

  describe('redos', function () {
    it('redos exploit', function () {
      // Invalid. This should be discovered in under 1 second.
      var attackString = 'a://localhost' + '9'.repeat(100000) + '\t';
      var before = process.hrtime();
      assert(!url(attackString), 'attackString was valid');
      var elapsed = process.hrtime(before);
      assert(elapsed[0] < 1, 'attackString took ' + elapsed[0] + ' > 1 seconds');
    });
  });
CVE-2021-4261 (PHP, published 2022-12-19T14:15Z)
Description: value: A vulnerability classified as critical has been found in pacman-canvas up to 1.0.5. Affected is the function addHighscore of the file data/db-handler.php. The manipulation leads to sql injection. It is possible to launch the attack remotely. Upgrading to version 1.0.6 is able to address this issue. The name of the patch is 29522c90ca1cebfce6453a5af5a45281d99b0646. It is recommended to upgrade the affected component. VDB-216270 is the identifier assigned to this vulnerability.
Severity: nan (CVSS v3 base score: 9.8)
Weakness: CWE-89 \u2014 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.
Repository: https://github.com/platzhersh/pacman-canvas
Files changed:
data/db-handler.php
Commit message: get rid of sql injection vulnerability


Vulnerable code:
	$db->exec('INSERT INTO highscore (name, score, level, date, log_referer, log_user_agent, log_remote_addr, log_remote_host, cheater) '
		. 'VALUES ("' 
			. $name . '", ' 
			. $score . ', ' 
			. $level . ', "' 
			. $date . '", "' 
			. $ref .'", "'
			. $ua . '", "'
			. $remA .'", "'
			. $remH . '", "'
			. $cheater
		.'")'
	);

Fixed code:
	$db->exec('INSERT INTO highscore (name, score, level, date, log_referer, log_user_agent, log_remote_addr, log_remote_host, cheater)VALUES(?,?,?,?,?,?,?,?,?)',$name, $score,$level,$date,$ref,$ua,$remA,$remH,$cheater);
CVE-2015-10053 (Ruby, published 2023-01-16T12:15Z)
Description: value: A vulnerability classified as critical has been found in prodigasistemas curupira up to 0.1.3. Affected is an unknown function of the file app/controllers/curupira/passwords_controller.rb. The manipulation leads to sql injection. Upgrading to version 0.1.4 is able to address this issue. The patch is identified as 93a9a77896bb66c949acb8e64bceafc74bc8c271. It is recommended to upgrade the affected component. VDB-218394 is the identifier assigned to this vulnerability.
Severity: nan (CVSS v3 base score: 9.8)
Weakness: CWE-89 \u2014 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.
Repository: https://github.com/prodigasistemas/curupira
Files changed:
app/controllers/curupira/passwords_controller.rb
Commit message: fixed SQL injection vulnerability


Vulnerable code:
    @user = User.find_by(params[:user])

Fixed code:
    @user = User.find_by(email: params[:user][:email])
CVE-2020-28248 (C++, published 2021-02-20T00:15Z)
Description: value: An integer overflow in the PngImg::InitStorage_() function of png-img before 3.1.0 leads to an under-allocation of heap memory and subsequently an exploitable heap-based buffer overflow when loading a crafted PNG file.
Severity: MEDIUM (CVSS v3 base score: 8.8)
Weakness: CWE-190 \u2014 Integer Overflow or Wraparound
The product performs a calculation that can
         produce an integer overflow or wraparound when the logic
         assumes that the resulting value will always be larger than
         the original value. This occurs when an integer value is
         incremented to a value that is too large to store in the
         associated representation. When this occurs, the value may
         become a very small or negative number.
Repository: https://github.com/gemini-testing/png-img
Files changed:
src/PngImg.cc
Commit message: Handle image size overflow


Vulnerable code:
    data_ = new png_byte[info_.height * info_.rowbytes];
        rowPtrs_[i] = data_ + i * info_.rowbytes;

Fixed code:
    // Extend height and rowbytes from uint32_t to size_t to avoid multiplication overflow when size_t is larger
    size_t h = info_.height;
    size_t rb = info_.rowbytes;
    // We need to make sure that info_.height * info_.rowbytes will not overflow size_t
    // Unfotunately, there's no simple and portable way to do this in C++
    // For integer division of positive numbers a * b > c <==> a > c / b holds
    if (h > std::numeric_limits<size_t>::max() / rb) {
        // TODO Propagate this exception to JS, and test it
        throw std::runtime_error("Image is too large to allocate single buffer");
    }
    data_ = new png_byte[h * rb];
        rowPtrs_[i] = data_ + i * rb;
CVE-2020-28248 (C++, published 2021-02-20T00:15Z)
Description: value: An integer overflow in the PngImg::InitStorage_() function of png-img before 3.1.0 leads to an under-allocation of heap memory and subsequently an exploitable heap-based buffer overflow when loading a crafted PNG file.
Severity: MEDIUM (CVSS v3 base score: 8.8)
Weakness: CWE-787 \u2014 Out-of-bounds Write
The product writes data past the end, or before the beginning, of the intended buffer.
Repository: https://github.com/gemini-testing/png-img
Files changed:
src/PngImg.cc
Commit message: Handle image size overflow


Vulnerable code:
    data_ = new png_byte[info_.height * info_.rowbytes];
        rowPtrs_[i] = data_ + i * info_.rowbytes;

Fixed code:
    // Extend height and rowbytes from uint32_t to size_t to avoid multiplication overflow when size_t is larger
    size_t h = info_.height;
    size_t rb = info_.rowbytes;
    // We need to make sure that info_.height * info_.rowbytes will not overflow size_t
    // Unfotunately, there's no simple and portable way to do this in C++
    // For integer division of positive numbers a * b > c <==> a > c / b holds
    if (h > std::numeric_limits<size_t>::max() / rb) {
        // TODO Propagate this exception to JS, and test it
        throw std::runtime_error("Image is too large to allocate single buffer");
    }
    data_ = new png_byte[h * rb];
        rowPtrs_[i] = data_ + i * rb;
CVE-2016-2537 (JavaScript, published 2016-02-23T05:59Z)
Description: value: The is-my-json-valid package before 2.12.4 for Node.js has an incorrect exports['utc-millisec'] regular expression, which allows remote attackers to cause a denial of service (blocked event loop) via a crafted string.
Severity: MEDIUM (CVSS v3 base score: 7.5)
Weakness: CWE-20 \u2014 Improper Input Validation
The product receives input or data, but it does
        not validate or incorrectly validates that the input has the
        properties that are required to process the data safely and
        correctly.
Repository: https://github.com/mafintosh/is-my-json-valid
Files changed:
formats.js
Commit message: fix utc-millisec regex to avoid a ddos attack


Vulnerable code:
exports['utc-millisec'] = /^[0-9]+(\.?[0-9]+)?$/

Fixed code:
exports['utc-millisec'] = /^[0-9]{1,15}\.?[0-9]{0,15}$/
CVE-2023-46300 (Objective-C, published 2023-10-22T04:15Z)
Description: value: iTerm2 before 3.4.20 allow (potentially remote) code execution because of mishandling of certain escape sequences related to tmux integration.
Severity: nan (CVSS v3 base score: 9.8)
Weakness: CWE-116 \u2014 Improper Encoding or Escaping of Output
The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.
Repository: https://github.com/gnachman/iTerm2
Files changed:
sources/VT100Terminal.m
Commit message: Fixes for method 1.

Remove DECSCPP and DECNLS.
Sanitize title reports to remove risky characters.


Vulnerable code:
                           [_delegate terminalIconTitle]];
                           [_delegate terminalWindowTitle]];
- (NSString *)decrqssDECSCPP {
    return self.columnMode ? @"132" : @"80";
}

- (NSString *)decrqssDECNLS {
    return [@([self.delegate terminalSizeInCells].height) stringValue];
}

    if ([pt isEqualToString:@"$|"]) {
        return [iTermPromise promiseValue:[self decrqssDECSCPP]];
    }
    if ([pt isEqualToString:@"*|"]) {
        return [iTermPromise promiseValue:[self decrqssDECNLS]];
    }

Fixed code:
                           [self reportSafeTitle:[_delegate terminalIconTitle]]];
                           [self reportSafeTitle:[_delegate terminalWindowTitle]]];
    // DECSCPP and DECNLS not supported for security reasons.
// Convert a title into a string that is safe to transmit in a report.
// The goal is to make it hard for an attacker to issue a report that could be part of a command.
- (NSString *)reportSafeTitle:(NSString *)unsafeTitle {
    NSCharacterSet *unsafeSet = [NSCharacterSet characterSetWithCharactersInString:@"|;\r\n\e"];
    NSString *result = unsafeTitle;
    NSRange range;
    range = [result rangeOfCharacterFromSet:unsafeSet];
    while (range.location != NSNotFound) {
        result = [result stringByReplacingCharactersInRange:range withString:@" "];
        range = [result rangeOfCharacterFromSet:unsafeSet];
    }
    return result;
}
// This is used for titles received from the remote host.
CVE-2023-46300 (Objective-C, published 2023-10-22T04:15Z)
Description: value: iTerm2 before 3.4.20 allow (potentially remote) code execution because of mishandling of certain escape sequences related to tmux integration.
Severity: nan (CVSS v3 base score: 9.8)
Weakness: CWE-116 \u2014 Improper Encoding or Escaping of Output
The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.
Repository: https://github.com/gnachman/iTerm2
Files changed:
sources/PTYSession.m
sources/TmuxController.h
sources/TmuxController.m
Commit message: Fix for method 1 and 2.

Send ^C as the first character of output when entering tmux integration mode.


Vulnerable code:

Fixed code:
    [_tmuxController sendControlC];
- (void)sendControlC;
- (void)sendControlC {
    [gateway_ sendCommand:[NSString stringWithFormat:@"%cphony-command", 3]
           responseTarget:nil
         responseSelector:nil
           responseObject:nil
                    flags:kTmuxGatewayCommandShouldTolerateErrors];
}
CVE-2023-46301 (Objective-C, published 2023-10-22T04:15Z)
Description: value: iTerm2 before 3.4.20 allow (potentially remote) code execution because of mishandling of certain escape sequences related to upload.
Severity: nan (CVSS v3 base score: 9.8)
Weakness: CWE-116 \u2014 Improper Encoding or Escaping of Output
The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.
Repository: https://github.com/gnachman/iTerm2
Files changed:
sources/VT100Terminal.m
Commit message: Fixes for method 1.

Remove DECSCPP and DECNLS.
Sanitize title reports to remove risky characters.


Vulnerable code:
                           [_delegate terminalIconTitle]];
                           [_delegate terminalWindowTitle]];
- (NSString *)decrqssDECSCPP {
    return self.columnMode ? @"132" : @"80";
}

- (NSString *)decrqssDECNLS {
    return [@([self.delegate terminalSizeInCells].height) stringValue];
}

    if ([pt isEqualToString:@"$|"]) {
        return [iTermPromise promiseValue:[self decrqssDECSCPP]];
    }
    if ([pt isEqualToString:@"*|"]) {
        return [iTermPromise promiseValue:[self decrqssDECNLS]];
    }

Fixed code:
                           [self reportSafeTitle:[_delegate terminalIconTitle]]];
                           [self reportSafeTitle:[_delegate terminalWindowTitle]]];
    // DECSCPP and DECNLS not supported for security reasons.
// Convert a title into a string that is safe to transmit in a report.
// The goal is to make it hard for an attacker to issue a report that could be part of a command.
- (NSString *)reportSafeTitle:(NSString *)unsafeTitle {
    NSCharacterSet *unsafeSet = [NSCharacterSet characterSetWithCharactersInString:@"|;\r\n\e"];
    NSString *result = unsafeTitle;
    NSRange range;
    range = [result rangeOfCharacterFromSet:unsafeSet];
    while (range.location != NSNotFound) {
        result = [result stringByReplacingCharactersInRange:range withString:@" "];
        range = [result rangeOfCharacterFromSet:unsafeSet];
    }
    return result;
}
// This is used for titles received from the remote host.