unsigned long CCharsetDetector::NextStateMachineState(const SMModel* const pSMModel, unsigned char Uint8Current, SMByteInfo* pTemSMByteInfo) { //for each byte we get its class , if it is first byte, we also get byte length unsigned char byteCls = GETFROMPCK((Uint8Current), pSMModel->classTable); unsigned char byteCls2 = getFromPck((Uint8Current), pSMModel->classTable); // fot test. if (pTemSMByteInfo->dwSMState == eStart) { pTemSMByteInfo->dwCurrentBytePos = 0; pTemSMByteInfo->dwCurrentCharLen = pSMModel->charLenTable[byteCls]; } //from byte's class and stateTable, we get its next state pTemSMByteInfo->dwSMState= (ESMState)GETFROMPCK((pTemSMByteInfo->dwSMState*(pSMModel->classFactor) + byteCls), pSMModel->stateTable); pTemSMByteInfo->dwCurrentBytePos++; return pTemSMByteInfo->dwSMState; }
nsSMState CVE_2013_0779_seamonkey2_13_2_NextState(char c){ //for each byte we get its class , if it is first byte, we also get byte length PRUint32 byteCls = GETCLASS(c); if (mCurrentState == eStart) { mCurrentBytePos = 0; mCurrentCharLen = mModel->charLenTable[byteCls]; } //from byte's class and stateTable, we get its next state mCurrentState=(nsSMState)GETFROMPCK(mCurrentState*(mModel->classFactor)+byteCls, mModel->stateTable); mCurrentBytePos++; return mCurrentState; }