392. Is Subsequence

本文介绍了一种算法,用于判断一个字符串S是否为另一个字符串T的子序列。通过比较两个字符串的大小并遍历检查,实现了高效的子序列判断。

判断S是否是T的一部分:

1) 若s.size()>t.size(),则return false;

2) 否则,从s和t首部开始遍历,若对应位置的字符相等,则s,t下标同时后移一位;否则,t下标后移一位

class Solution {
public:
    bool isSubsequence(string s, string t) {
        if(s.size()> t.size())
            return 0;
        int flag=0;
        for(int i=0,j=0;i<s.size()&&j<t.size();)
        {
            if(s[i]==t[j])
            {
                i++;
                j++;
                flag++;
            }
            else
            {
                j++;
                
            }
        }
        if(flag==s.size())
            return 1;
        else
            return 0;
    }
};

CVE-2022-41741 A vulnerability in the module ngx_http_mp4_module might allow a local attacker to corrupt NGINX worker memory, resulting in its termination or potential other impact using a specially crafted audio or video file. The attack is only possible if an attacker can gain privileged access to the host running NGINX, place a specially crafted audio or video file within the webroot, and then trigger NGINX to process the specially crafted file. v3.1 v4.0 Base 7.0 7.3 CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N CVSS v4 Score: Base 7.3 Metric Value Comments Attack Vector Local An attacker must be able to access the vulnerable system with a local, interactive session. Attack Complexity Low No specialized conditions or advanced knowledge are required. Attack Requirements Present Multiple conditions that require target specific reconnaissance and preparation must be satisfied in order to achieve successful exploitation of this vulnerability. Privileges Required Low An attacker must be able to place a file within the web root to be processed by NGINX. User Interaction None No user interaction is required for an attacker to successfully exploit the vulnerability. Vulnerable System Confidentiality High The attacker could execute arbitrary code on the vulnerable system with elevated privileges. Vulnerable System Integrity High The attacker could execute arbitrary code on the vulnerable system with elevated privileges. Vulnerable System Availability High The attacker could execute arbitrary code on the vulnerable system with elevated privileges. Subsequent System Confidentiality None There is no impact to the subsequent system confidentiality. Subsequent System Integrity None There is no impact to the subsequent system integrity. Subsequent System Availability None There is no impact to the subsequent system availability. CVE-2020-3549 A vulnerability in the sftunnel functionality of Cisco Firepower Management Center (FMC) Software and Cisco Firepower Threat Defense (FTD) Software could allow an unauthenticated, remote attacker to obtain the device registration hash. The vulnerability is due to insufficient sftunnel negotiation protection during initial device registration. An attacker in a man-in-the-middle position could exploit this vulnerability by intercepting a specific flow of the sftunnel communication between an FMC device and an FTD device. A successful exploit could allow the attacker to decrypt and modify the sftunnel communication between FMC and FTD devices, allowing the attacker to modify configuration data sent from an FMC device to an FTD device or alert data sent from an FTD device to an FMC device. v3.1 v4.0 Base 8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H 7.7 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N Base + Threat 5.2 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U CVSS v4 Score: Base + Threat 5.2 Metric Value Comments Attack Vector Network The vulnerable system is accessible from remote networks. Attack Complexity Low No specialized conditions or advanced knowledge are required. Attack Requirements Present An attacker must be on-path to be able to intercept communications between affected systems. Privileges Required None No privileges are required for an attacker to successfully exploit the vulnerability. User Interaction Passive A user must be logged in and using the application for traffic to be generated that an attacker could capture. Vulnerable System Confidentiality High An attacker could gain access to the system with a highly privileged user account. Vulnerable System Integrity High An attacker could gain access to the system with a highly privileged user account. Vulnerable System Availability High An attacker could gain access to the system with a highly privileged user account. Subsequent System Confidentiality None There is no impact to the vulnerable system confidentiality. Subsequent System Integrity None There is no impact to the vulnerable system integrity. Subsequent System Availability None There is no impact to the vulnerable system availability. Exploit Maturity Unreported There is no known proof-of-concept code or malicious exploitation of this vulnerability.
最新发布
07-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值