ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Loadrunner 8.0 二维指针运行报错问题

Loadrunner 8.0 二维指针运行报错问题

原创 Linux操作系统 作者:bocnono 时间:2010-05-31 16:11:33 0 删除 编辑
在Loadrunner 8.0 VU脚本编写时如脚本中包含了二维指针,则报如下错误:
Error: An exception was raised while calling invocation function in interpreter extension cciext.dll: System Exceptions: EXCEPTION_ACCESS_VIOLATION.
如下代码:
#include "web_api.h"

int escape_url_character(char *data, int data_len)
{
  
    char  * transfer_table[][2] = {
        {"+", "2B"}, {"[","5B"},{"]","5D"},{"`","60"},
        {";","3B"},{"/","2F"},{"?","3F"},{":","3A"},
        {"@","40"},{"=","3D"},{"&","26"},{"$","24"},
        {" ","20"},{"<","3C"},{">","3E"},{"#","23"},
        {"%","25"},{"{","7B"},{"}","7D"},{"|","7C"},
        {"\\","5C"},{"^","5E"},{"~","7E"}, {NULL, NULL} };

    int i = 0, j;
    char *buf = (char*) calloc(data_len + 1, sizeof(char));

    while( i < data_len ){
        if( '%' != data[i]){
            strncat(buf, data+i, 1);
            i++;
            continue;
        }

 
        j = 0;
        while( NULL != transfer_table[j][1] ){
            if( 0 == strncmp(data+i+1, transfer_table[j][1], 2 )){
                strncat(buf, transfer_table[j][0], 1);
                i += 3;
                break;
            }
            j++;
        }
    
        if( NULL == transfer_table[j][1] ){
            strncat(buf, data+i, 1);
           /* printf("escape_url_character: unhandled sequence: %s\n", data+i);*/
            i++;
        }
    }

    memset(data, 0, data_len);
    strcpy(data, buf);

    free(buf);
    return 0;
}
Action()
{

    return 0;
}


此种情况下将二维指针改为三维数组就能运行通过,即上面代码char  * transfer_table[][2] 改为char transfer_table[24][2][3]就能运行通过了。
这也许是LoadRunner的一个bug

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/20652124/viewspace-664107/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2010-05-31

  • 博文量
    2
  • 访问量
    8199