diff options
author | Andreas Schneider <asn@samba.org> | 2012-12-17 14:40:17 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2012-12-21 13:56:00 +0100 |
commit | b26a9eae1648ecfa9912aa8ce81e0f0ea674ca53 (patch) | |
tree | b74658ac78eb60df11bb69b6ed2cdeef2451dd7a /source3/rpc_server | |
parent | d0e20998a232b793d3e5db7dff70c84d11d2c527 (diff) | |
download | samba-b26a9eae1648ecfa9912aa8ce81e0f0ea674ca53.tar.gz samba-b26a9eae1648ecfa9912aa8ce81e0f0ea674ca53.tar.bz2 samba-b26a9eae1648ecfa9912aa8ce81e0f0ea674ca53.zip |
s3-rpc_server: Fix useless check if we still have a valid string.
Found by Coverity.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/svcctl/srv_svcctl_reg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/rpc_server/svcctl/srv_svcctl_reg.c b/source3/rpc_server/svcctl/srv_svcctl_reg.c index 930c327622..07b7ce6d4b 100644 --- a/source3/rpc_server/svcctl/srv_svcctl_reg.c +++ b/source3/rpc_server/svcctl/srv_svcctl_reg.c @@ -224,13 +224,13 @@ static bool read_init_file(TALLOC_CTX *mem_ctx, p = strstr(str, "Description:"); if (p != NULL) { char *desc; + size_t len = strlen(p); - p += strlen( "Description:" ) + 1; - if (p == NULL) { + if (len <= 12) { break; } - desc = svcctl_cleanup_string(mem_ctx, p); + desc = svcctl_cleanup_string(mem_ctx, p + 12); if (desc != NULL) { info->description = talloc_strdup(info, desc); } |