Commit 25c7a4e4 authored by claes's avatar claes

Segfault when opening profibus configurator with empty attr gsdfile fixed

parent 5be189cb
......@@ -12,3 +12,4 @@
070430 rk - Changed status handling of Profibus slaves so that correct
view of the world is given.
070518 rk - Added io-method IoAgentSwap to keep driver initialized during warm restart.
070601 cs - Buxfix, opening Profibus Configurator with empty gsdfile attribute caused segfault.
/*
* Proview $Id: wb_c_pb_dp_slave.cpp,v 1.8 2007-01-04 08:44:02 claes Exp $
* Proview $Id: wb_c_pb_dp_slave.cpp,v 1.9 2007-06-01 12:53:51 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -481,7 +481,7 @@ pwr_tStatus pb_dp_slave_create_ctx( ldh_tSession ldhses, pwr_tAttrRef aref,
if ( EVEN(sts)) return sts;
if ( strcmp( gsdfile, "") == 0) {
free( gsdfile);
return 1;
return PB__GSDATTR;
}
slave_sCtx *ctx = (slave_sCtx *) calloc( 1, sizeof(slave_sCtx));
......
/*
* Proview $Id: xtt_c_pb_dp_slave.cpp,v 1.4 2007-01-04 08:44:40 claes Exp $
* Proview $Id: xtt_c_pb_dp_slave.cpp,v 1.5 2007-06-01 12:53:51 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -32,6 +32,7 @@
#include "rt_pb_gsd.h"
#include "rt_pb_gsd_attr.h"
#include "xtt_c_pb_dp_slave.h"
#include "rt_pb_msg.h"
int xtt_pb_dp_slave_help_cb( void *sctx, char *text)
{
......@@ -175,7 +176,7 @@ pwr_tStatus xtt_pb_dp_slave_create_ctx( pwr_tAttrRef aref, void *editor_ctx,
sts = gdh_GetObjectInfoAttrref( &aaref, gsdfile, sizeof(gsdfile));
if ( EVEN(sts)) return sts;
if ( strcmp( gsdfile, "") == 0) {
return 1;
return PB__GSDATTR;
}
xtt_slave_sCtx *ctx = (xtt_slave_sCtx *) calloc( 1, sizeof(xtt_slave_sCtx));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment